[OpenLayers-Users] externalGraphic anchoring points?

William Martin williammartin at mail.und.nodak.edu
Tue Jul 27 11:40:20 EDT 2010


All,

Hi, new user.  I'm using a vector layer for placing markers on the map, and I'm using the externalGraphic property to specify a marker of my own.  How is that image anchored with respect to the lat/lon coordinates that it represents?

That is, if exactly one pixel in the external graphic corresponds to the point on the map, is it:

a) The top left corner pixel
b) The top right corner pixel
c) The bottom left corner pixel
d) The bottom right corner pixel
e) The exact center pixel
f) A pixel halfway along one edge
Or g) something else entirely?

I need to know so that I can figure out the correct offsets to use with my graphic.

I tried to figure this out by using an external graphic for the marker which was a 1x1 pixel animated GIF blinking red/white/red/white and then defining another marker for the same coordinates with a translucent version of the regular image.  But the 1x1 graphic refused to show up, even when I disabled the other marker so that it was on its own.  Weird.

Thanks!

Will Martin
Web Services Librarian
Chester Fritz Library, University of North Dakota




More information about the Users mailing list