Skip to content

Commit

Permalink
Merge pull request ROGUE-JCTD#179 from BerryDaniel/osm_url#176
Browse files Browse the repository at this point in the history
Added ability to customize the OSM url
  • Loading branch information
smesdaghi committed Dec 24, 2015
2 parents 5c91333 + c17480d commit 919155e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/common/map/MapService.js
Original file line number Diff line number Diff line change
Expand Up @@ -550,14 +550,25 @@
});
} else {
if (server.ptype === 'gxp_osmsource') {
var osmLocal = {
attributions: [
new ol.Attribution({
html: settings.OsmLocalAttribution
}),
ol.source.OSM.ATTRIBUTION
],
crossOrigin: null,
url: settings.OsmLocalUrl
};
var osmSource = (settings.OsmLocalUrl !== 'default') ? osmLocal : '';
layer = new ol.layer.Tile({
metadata: {
serverId: server.id,
name: minimalConfig.name,
title: fullConfig.Title
},
visible: minimalConfig.visibility,
source: new ol.source.OSM()
source: new ol.source.OSM(osmSource)
});
} else if (server.ptype === 'gxp_bingsource') {

Expand Down
6 changes: 5 additions & 1 deletion src/common/utils/Globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ var settings = {
MGRSPrecision: 10,
WFSVersion: '1.1.0',
WMSVersion: '1.1.1',
WPSVersion: '1.0.0'
WPSVersion: '1.0.0',
//Set to OsmLocalUrl to 'default' for default mapnick osm basemap
OsmLocalUrl: 'default',
//OsmLocalUrl: 'http://{a-c}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png',
OsmLocalAttribution: 'All maps &copy; <a href="http://www.opencyclemap.org/">OpenCycleMap</a>'
};

var forEachArrayish = function(arrayish, funct) {
Expand Down

0 comments on commit 919155e

Please sign in to comment.