Skip to content

Commit c17480d

Browse files
author
Daniel Berry
committed
Added ability to customize the OSM url
1 parent 5897fa5 commit c17480d

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

Diff for: src/common/map/MapService.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -550,14 +550,25 @@
550550
});
551551
} else {
552552
if (server.ptype === 'gxp_osmsource') {
553+
var osmLocal = {
554+
attributions: [
555+
new ol.Attribution({
556+
html: settings.OsmLocalAttribution
557+
}),
558+
ol.source.OSM.ATTRIBUTION
559+
],
560+
crossOrigin: null,
561+
url: settings.OsmLocalUrl
562+
};
563+
var osmSource = (settings.OsmLocalUrl !== 'default') ? osmLocal : '';
553564
layer = new ol.layer.Tile({
554565
metadata: {
555566
serverId: server.id,
556567
name: minimalConfig.name,
557568
title: fullConfig.Title
558569
},
559570
visible: minimalConfig.visibility,
560-
source: new ol.source.OSM()
571+
source: new ol.source.OSM(osmSource)
561572
});
562573
} else if (server.ptype === 'gxp_bingsource') {
563574

Diff for: src/common/utils/Globals.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ var settings = {
99
DDPrecision: 8,
1010
WFSVersion: '1.1.0',
1111
WMSVersion: '1.1.1',
12-
WPSVersion: '1.0.0'
12+
WPSVersion: '1.0.0',
13+
//Set to OsmLocalUrl to 'default' for default mapnick osm basemap
14+
OsmLocalUrl: 'default',
15+
//OsmLocalUrl: 'http://{a-c}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png',
16+
OsmLocalAttribution: 'All maps &copy; <a href="http://www.opencyclemap.org/">OpenCycleMap</a>'
1317
};
1418

1519
var forEachArrayish = function(arrayish, funct) {

0 commit comments

Comments
 (0)