[OpenLayers-Users] externalGraphic anchoring points?

christopher.schmidt at nokia.com christopher.schmidt at nokia.com
Tue Jul 27 13:20:23 EDT 2010


On Jul 27, 2010, at 12:14 PM, ext Stephen Woodbridge wrote:

> I believe the origin of an image is the upper-left corner, so you need 
> to specify your offsets based on that point.

I don't think so. I believe externalGraphics center, by default, on the 
center of the image. (I don't know what happens for images where this is
a half pixel; I assume we round somehow, but I don't know how.)

-- Chris

> -Steve
> 
> William Martin wrote:
>> 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
>> 
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users




More information about the Users mailing list