BecArt
August 12, 2016, 10:41am
#1
Hi,
I found on this link how to add the OSM layer on Google Maps:
http://wiki.openstreetmap.org/wiki/Google_Maps_Example (Example - Using Google Maps API v3 setting OSM as a base map layer)
How can I add to this OpenCycleMap layer?
Thanks in advance,
Midhat
escada
(Escada)
August 12, 2016, 11:15am
#2
Use one of the tile URL’s for OpenCycleMap found on http://wiki.openstreetmap.org/wiki/Tile_servers
instead of the line return “http://tile.openstreetmap.org/ ” + zoom + “/” + x + “/” + coord.y + “.png”;
BecArt
August 12, 2016, 1:40pm
#3
Hi,
Thank you for your help. On this link I was unable to find tile URL’s for OpenCycleMap.
I found it on http://thunderforest.com/maps/opencyclemap/ , registred for free api and add tile URL’s
https://[abc].tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=
instead of the line return “http://tile.openstreetmap.org/ ” + zoom + “/” + x + “/” + coord.y + “.png”; but not working
Did I do something wrong?
escada
(Escada)
August 12, 2016, 7:23pm
#4
Isn’t the third map from the top the one you are looking for ? The under “a” or “b” you have the URLs for the tiles
I see in the one you list from thunderforest. Did you replace that with the API key you got from thunderforest (or whereever you can get that api key) ?
BecArt
August 12, 2016, 10:24pm
#5
escada
(Escada)
August 13, 2016, 5:49am
#6
Did you replace the %7D with } and %7B with { ?
BecArt
August 13, 2016, 7:00am
#7
Yes I did.
This is my file:
http://planinarenje.ba/b.html
Can you please look at the source code?
mmd
August 13, 2016, 9:52am
#8
You need to stick to the format mentioned on that Google Maps wiki page:
return “http://tile.openstreetmap.org/ ” + zoom + “/” + x + “/” + coord.y + “.png”;
Don’t put in any “{” or “}” placeholders, they only work with other frameworks, like OpenLayers or Leaflet.
BecArt
August 13, 2016, 10:25am
#9
mmd:
You need to stick to the format mentioned on that Google Maps wiki page:
return “http://tile.openstreetmap.org/ ” + zoom + “/” + x + “/” + coord.y + “.png”;
Don’t put in any “{” or “}” placeholders, they only work with other frameworks, like OpenLayers or Leaflet.
But how can I add OpenCycle layer on this google map?
mmd
August 13, 2016, 10:56am
#10
return “http://tile.thunderforest.com/cycle/ ” + zoom + “/” + x + “/” + coord.y + “.png”;
Please don’t forget the OSM attribution!
BecArt
August 13, 2016, 11:12am
#11
I tried with this new URL but again does not work http://planinarenje.ba/b.html
What is OSM attribution?
Anything else I need to change?
Thank You for your time and help
mmd
August 13, 2016, 12:01pm
#12
Try + coord.x + instead of + x +
I assumed you were using the other example as a template