add ol.source.MapQuestHybrid and add all MapQuest types to the example

This commit is contained in:
Bart van den Eijnden
2014-01-08 12:05:19 +01:00
parent 4e4e3c24b4
commit 1b48572c6e
4 changed files with 79 additions and 6 deletions

View File

@@ -1,3 +1,4 @@
goog.provide('ol.source.MapQuestHybrid');
goog.provide('ol.source.MapQuestOSM');
goog.provide('ol.source.MapQuestOpenAerial');
@@ -73,3 +74,36 @@ ol.source.MapQuestOpenAerial = function(opt_options) {
};
goog.inherits(ol.source.MapQuestOpenAerial, ol.source.XYZ);
/**
* @constructor
* @extends {ol.source.XYZ}
* @param {olx.source.MapQuestOptions=} opt_options MapQuest options.
* @todo stability experimental
*/
ol.source.MapQuestHybrid = function(opt_options) {
var options = goog.isDef(opt_options) ? opt_options : {};
var attributions = [
new ol.Attribution({
html: 'Tiles Courtesy of ' +
'<a href="http://www.mapquest.com/" target="_blank">MapQuest</a>'
}),
ol.source.OSM.DATA_ATTRIBUTION
];
goog.base(this, {
attributions: attributions,
crossOrigin: 'anonymous',
logo: 'http://developer.mapquest.com/content/osm/mq_logo.png',
maxZoom: 18,
opaque: true,
tileLoadFunction: options.tileLoadFunction,
url: 'http://oatile{1-4}.mqcdn.com/tiles/1.0.0/hyb/{z}/{x}/{y}.jpg'
});
};
goog.inherits(ol.source.MapQuestHybrid, ol.source.XYZ);