NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

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%


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

permanent link

answered 16 Feb '17, 12:08

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

edited 16 Feb '17, 12:08

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×535
×39

question asked: 16 Feb '17, 11:54

question was seen: 2,241 times

last updated: 16 Feb '17, 12:08

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum