I'm creating a system that pulls Longitude/Latitude data from the MapQuest hosted Nominatim service. I'm using OpenStreetMap/OpenLayers to display markers on a map. In order to compute the location to place the marker, I use the following code:
var location = ol.proj.transform([eventData.Longitude, eventData.Latitude], 'EPSG:4326', 'EPSG:900913'); However, it does not place the marker in the correct location. Whenever I use the coordinates returned from this online converter (converting from WGS84 (SRID=4326) to Google Transverse Mercator (SRID=900913)), the markers appear in the correct location.
Here's an example: Lon/Lat: -122.0850862, 37.4228139 OpenLayers Projection: -13590449.62, -6905168.54 Online Projection: -13590449.62, 4498206.60
My map uses the 'EPSG: 900913' projection. Does anyone know why the OpenLayers projection is placing the marker in the incorrect location?
أكثر...
var location = ol.proj.transform([eventData.Longitude, eventData.Latitude], 'EPSG:4326', 'EPSG:900913'); However, it does not place the marker in the correct location. Whenever I use the coordinates returned from this online converter (converting from WGS84 (SRID=4326) to Google Transverse Mercator (SRID=900913)), the markers appear in the correct location.
Here's an example: Lon/Lat: -122.0850862, 37.4228139 OpenLayers Projection: -13590449.62, -6905168.54 Online Projection: -13590449.62, 4498206.60
My map uses the 'EPSG: 900913' projection. Does anyone know why the OpenLayers projection is placing the marker in the incorrect location?
أكثر...