Allow tileLoadFunction override for ol.source.MapQuestOSM and MapQuestOpenAerial

This commit is contained in:
Frederic Junod
2013-09-24 15:54:53 +02:00
parent 9fcd057c1e
commit 907e796b55
2 changed files with 16 additions and 2 deletions

View File

@@ -10,8 +10,11 @@ goog.require('ol.source.XYZ');
/**
* @constructor
* @extends {ol.source.XYZ}
* @param {ol.source.MapQuestOptions=} opt_options MapQuest options.
*/
ol.source.MapQuestOSM = function() {
ol.source.MapQuestOSM = function(opt_options) {
var options = goog.isDef(opt_options) ? opt_options : {};
var attributions = [
new ol.Attribution({
@@ -27,6 +30,7 @@ ol.source.MapQuestOSM = function() {
logo: 'http://developer.mapquest.com/content/osm/mq_logo.png',
opaque: true,
maxZoom: 28,
tileLoadFunction: options.tileLoadFunction,
url: 'http://otile{1-4}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.jpg'
});
@@ -38,8 +42,11 @@ goog.inherits(ol.source.MapQuestOSM, ol.source.XYZ);
/**
* @constructor
* @extends {ol.source.XYZ}
* @param {ol.source.MapQuestOptions=} opt_options MapQuest options.
*/
ol.source.MapQuestOpenAerial = function() {
ol.source.MapQuestOpenAerial = function(opt_options) {
var options = goog.isDef(opt_options) ? opt_options : {};
var attributions = [
new ol.Attribution({
@@ -58,6 +65,7 @@ ol.source.MapQuestOpenAerial = function() {
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/sat/{z}/{x}/{y}.jpg'
});