But with this particular icon as a user I would expect the focal point to be in the dot which is approximately in the center of the icon.
But I get the logic behind this now more clearly at least, thanks for the explanation (also Andrew ofcourse). Best regards, Bart -- Bart van den Eijnden OSGIS, Open Source GIS http://www.osgis.nl --------- Oorspronkelijk bericht -------- Van: Erik Uzureau <[EMAIL PROTECTED]> Naar: Bart van den Eijnden OSGIS <[EMAIL PROTECTED]> Cc: [email protected] Onderwerp: Re: [OpenLayers-Dev] defaultIcon: calculateOffset Datum: 29/10/07 13:42 > Basically this is because the general markers (icons) that we've been > working with are sort of like the gmaps one: the point of focus is on > the bottom line center of the icon itself. > > e > > On 10/29/07, Bart van den Eijnden (OSGIS) <[EMAIL PROTECTED]> wrote: > > Hi list, > > > > can anybody explain why the calculateOffset from the defaultIcon places the > > icon on top of the point, and not in the center of the point? > > > > OpenLayers.Marker.defaultIcon = function() { > > var url = OpenLayers.Util.getImagesLocation() + "marker.png"; > > var size = new OpenLayers.Size(21, 25); > > var calculateOffset = function(size) { > > return new OpenLayers.Pixel(-(size.w/2), -size.h); > > }; > > > > return new OpenLayers.Icon(url, size, null, calculateOffset); > > > > Best regards, > > Bart > > > > -- > > Bart van den Eijnden > > OSGIS, Open Source GIS > > http://www.osgis.nl > > > > > > > > > > > > _______________________________________________ > > Dev mailing list > > [email protected] > > http://openlayers.org/mailman/listinfo/dev > > > > _______________________________________________ Dev mailing list [email protected] http://openlayers.org/mailman/listinfo/dev
