Martin
Martin

Reputation: 2300

OpenLayers container position from lat/long

Is it possible to get position inside the OpenLayers container from a lat/long point?

Google Maps has something like this:

var markerOffset = map.fromLatLngToDivPixel(marker.getLatLng());

Can I do the same thing in OpenLayers?

Upvotes: 0

Views: 754

Answers (1)

tonio
tonio

Reputation: 2376

See the getPixelFromLonLat[1] method from map object.

1 - http://dev.openlayers.org/docs/files/OpenLayers/Map-js.html#OpenLayers.Map.getPixelFromLonLat

Upvotes: 1

Related Questions