I am using LeafletJS to display points on a MapBox map. The points are not lining up though. They are close but not exact.
I have my setView set to the following location:
var mymap = L.map('mapid').setView([40.311420, -75.134643], 17);
Then I am trying to plot a point at 40.310676, -75.138090 by doing this:
temp.LatLng = new L.LatLng(40.310653, -75.138070);
g.append("circle")
.attr("cx", temp.LatLng.lat)
.attr("cy", temp.LatLng.lng)
.attr("r", 10)
.attr("fill", "#ffff00")
.attr("stroke", "#ffff00")
.attr("transform", "translate(" + mymap.latLngToLayerPoint(temp.LatLng).x + "," + mymap.latLngToLayerPoint(temp.LatLng).y + ")");
As you can see in the image below the point (in yellow) does show up but it is not in the correct location. It should be where the red dot is. enter image description here
Thank you in advance for any help you might be able to supply.