This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

local map server in tile layer

0

Hi,

I have a local tile server which is setup using mapnik.

Following code is not working when I add my local map server URL.

Please tell me how can I add my local map in below sample code. Is there anything I need to do from serverside?

Sample Code:

layers: [ new ol.layer.Tile({ source: new ol.source.OSM({ url: 'http://testmap.com/{z}/{x}/{y}.png' }) }),

asked 16 Feb '17, 11:54

Reshma%20Maner's gravatar image

Reshma Maner
235303136
accept rate: 0%


One Answer:

1

I assume that you have properly set up either renderd or tirex. If not, do that first. Then you need to have your ModTile directives in the Apache config set accordingly. If you want tiles to be available under / like in your above example, and if your map style is called "osm", then you'd need

AddTileConfig / osm

Read more here: https://github.com/openstreetmap/mod_tile/blob/master/mod_tile.conf

answered 16 Feb '17, 12:08

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

edited 16 Feb '17, 12:08

Source code available on GitHub .