0

I have been experimenting with cloudmade and leaflet and would like to use a snippet of code from cloudmade into my leaflet code. I have both script tags in my header and define the leaflet map by:

var map = L.map('map').setView([lat, -long], 13);

L.tileLayer('http://{s}.tile.cloudmade.com/APIKEY/STYLE/256/{z}/{x}/{y}.png', {
    minZoom:6,
    maxZoom: 18,
    keyboardZoomOffset:2
}).addTo(map);

The snippet i would like to use from Cloudmade is this: http://developers.cloudmade.com/projects/web-maps-api/examples/custom-map-controls

I have tried to re-build this and implement however with the code it contains CM objects/methods. All i need is 3 links on the map so when the user clicks them it takes them to the lat/long stored. If anyone could guide me this would be great.

I am not a Javascript map pro- but assuming this is not a big issue and is my misunderstanding between the two plugins.

Note: I have took out my API and style ID in this example. Note: I have also asked on leaflet/cloudmade forums and no replys but many views!

Thank You

Shimsham84
  • 227
  • 2
  • 12
  • 29
  • I should include that when i do preview the map in the browser: Leaflet map assets show and works, just the snippet from Cloudmade doesn't show at all. – Shimsham84 Nov 09 '12 at 11:22

1 Answers1

2

Leaflet creator here. Check out the code example on Leaflet API reference page: http://leafletjs.com/reference.html#icontrol Hope this helps.

Mourner
  • 3,171
  • 24
  • 21
  • Thanks for your support, i will look into this and will post my findings and results. – Shimsham84 Nov 12 '12 at 14:38
  • Hi there, had a look at the documentation and i am still unsure of how to use this in leaflet. I have the map set up using the "layers tutorial" and this is where i would like the list "city 1" city 2" and city3. Its just to make them a link not a toggle button and to to locate to the saved marker location. ANy other links or references would be great, Thanks! – Shimsham84 Nov 15 '12 at 16:45