0

I'm trying to get the position of a marker on a mapbox map in order to show a div in that position.

This is the code I tried but it does not do anything:

var a = $(geojson[0].features[1]).offset();
alert(a.top);
rink.attendant.6
  • 44,500
  • 61
  • 101
  • 156
  • 1
    You gotta show some more code, it is not clear enough. – Jonatas Walker Jun 09 '15 at 12:15
  • Is your data stored in a geoJSON file by any chance? If so you could loop through the object and return the coordinates. That's what I would do. – JasTonAChair Jun 10 '15 at 08:02
  • as Jonatas said, you need to provide a full working example of the code. We need to see how you init and store the layer so we can later loop through it and find the specific feature you want, which will let you grab the coordinates. – snkashis Jun 10 '15 at 14:58

0 Answers0