2

Using leaflet, you can draw on a given map by adding a Canvas layer. Some instructions are given here, http://leaflet.cloudmade.com/reference.html#tilelayer-canvas

var canvasTiles = new L.TileLayer.Canvas();

canvasTiles.drawTile = function(canvas, tilePoint, zoom) {
    var ctx = canvas.getContext('2d');
    // draw something on the tile canvas
}

However, I'd like to to draw at a specific lat-long location on the map, can that be done?

1

You should look at defining a custom layer: http://leaflet.cloudmade.com/reference.html#ilayer

0

So canvas layer might be a bit of overkill to you it might make sense to look at marker or circle marker if you do need to use a canvas layer I believe you have to transform the latlng into the layer coordinates system, and then use the canvas layer functions to map it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.