Survey banner
Share your feedback on the Dataiku documentation with this 5 min survey. Thanks! TAKE THE SURVEY

Change Map Charts Tile Server

Solved!
SimonP
Level 1
Change Map Charts Tile Server

Hi !

I am using Dataiku on a private network with no Internet access.

I howerver have acces to internal tile serveurs.

Is there any way so i can use them instead of the preconfigured Internet Openstreet Map Server.

Thanks for your help.


Operating system used: Linux

0 Kudos
1 Solution
JordanB
Dataiker

Hi @SimonP,

Yes, assuming your tile server follows the Mapnik-style convention. You would need to create a new plugin in the plugin dev tool. https://doc.dataiku.com/dss/latest/plugins/reference/index.html
In the plugin, create a "js" folder, and inside, create a .js file (ex: mybackground.js), with the following content:
(function() {
​
dkuMapBackgrounds.addCustom({
"id": "my-osm-server",
"name": "My OSM Server",
"getTileLayer": function () {
return new L.tileLayer(
'http://YOUR_SERVER_URL/PREFIX/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy;'
})
},
"fadeColor": "#333"
})

})();
​
The URL/PREFIX must match so that z is the zoom level and x and y are the tile index
Then refresh the page, and a new background should be ​available.
It is not possible to change the default value.
Thanks,
Jordan

View solution in original post

0 Kudos
2 Replies
JordanB
Dataiker

Hi @SimonP,

Yes, assuming your tile server follows the Mapnik-style convention. You would need to create a new plugin in the plugin dev tool. https://doc.dataiku.com/dss/latest/plugins/reference/index.html
In the plugin, create a "js" folder, and inside, create a .js file (ex: mybackground.js), with the following content:
(function() {
​
dkuMapBackgrounds.addCustom({
"id": "my-osm-server",
"name": "My OSM Server",
"getTileLayer": function () {
return new L.tileLayer(
'http://YOUR_SERVER_URL/PREFIX/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy;'
})
},
"fadeColor": "#333"
})

})();
​
The URL/PREFIX must match so that z is the zoom level and x and y are the tile index
Then refresh the page, and a new background should be ​available.
It is not possible to change the default value.
Thanks,
Jordan
0 Kudos
SimonP
Level 1
Author

Thanks a lot @JordanB !