javascript - leaflet how to add circle by coordinates? -
next code add circle map:
var mylayer = l.circle([60, 54.75621], 200).addto(window.map);
but want add coordinates variable: eq.coordinates
console.log(eq.coordinates);
print on console: point(31.5 42.2)
i want like:
var mylayer = l.circle(eq.coordinates).addto(window.map);
l.circle wants latlng coordinates.
if want use pixel coordinates have convert them latlng coordinates using http://leafletjs.com/reference-1.0.0.html#map-containerpointtolayerpoint
if put example online, helping you
Comments
Post a Comment