[OpenLayers-Users] All marker offsets are wrong when using
features
Zac Spitzer
zac.spitzer at gmail.com
Mon Jan 12 19:27:24 EST 2009
var style = new OpenLayers.Style({
externalGraphic: "images/openlayers/AQUA.png",
pointRadius: 9,
graphicYOffset : -15
});
poi = new OpenLayers.Layer.Vector("poi", {
strategies: [new OpenLayers.Strategy.BBOX({ratio: 1.1})],
protocol: new OpenLayers.Protocol.HTTP({
url: "/poi.cfm",
params: { scale: map.getScale() }, // this is static
format: new OpenLayers.Format.GeoJSON()
}),
styleMap: new OpenLayers.StyleMap(style)
});
On Tue, Jan 13, 2009 at 10:04 AM, Deluded <rich at deluded.co.uk> wrote:
>
>
> zspitzer wrote:
>>
>> i've hit this one as well, playing around with styles after reading
>> through
>> some of the api code,
>>
>> i did this which seem to help offset the bottom of the marker directly
>> on the point
>>
>> var style = new OpenLayers.Style({
>> externalGraphic: "images/openlayers/AQUA.png",
>> pointRadius: 9,
>> graphicYOffset : -15
>> });
>>
>> z
>>
>
> Sorry to be thick, but what do I apply this style object to?
>
> I've tried feature.style = style; but doesn't do anything.
> The docs reference the new styles layer - but this seems a bit excesive to
> simply move an icon a few pixels.
>
> Thanks,
>
> Rich.
>
> --
> View this message in context: http://n2.nabble.com/All-marker-offsets-are-wrong-when-using-features-tp2143419p2148478.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
--
Zac Spitzer -
http://zacster.blogspot.com
+61 405 847 168
More information about the Users
mailing list