[OpenLayers-Users] Problem with Layer.vector
Nicholas Efremov-Kendall
n.e.kendall at gmail.com
Tue Aug 4 13:29:23 EDT 2009
Hi Eric,
I'm still new to Jscript, can you clarify this a little? or point me in the
right direction?
best,
Nick
On Tue, Aug 4, 2009 at 7:47 AM, Eric Lemoine <eric.lemoine at camptocamp.com>wrote:
> On Monday, August 3, 2009, Nicholas Efremov-Kendall
> <n.e.kendall at gmail.com> wrote:
> > Hi all,I've been trying to implement my gml as a layer.vector, as opposed
> to a layer.gml. I'm loading both into the browser with the different
> methods, and I can from firebug that the file is getting loaded, but it's
> not being displayed. Thus, if I re-sent my auto-center to sites2.events, it
> doesn't center at all. I'm not sure what going wrong here, I thought I'd
> followed the examples pretty closely. Thanks (again) in advance.
> > //loads fine var sites = new OpenLayers.Layer.GML (
> > "Archaeological Sites", "data/siteswatr.gml",
> > {
> > style: {pointRadius: 2.5},
> > projection: new OpenLayers.Projection("EPSG:4326"),
> > format: OpenLayers.Format.GML,
> > }
> > );
> > map.addLayer(sites);
> > // loads into browser but not displayed.
> > var sites2 = new OpenLayers.Layer.Vector (
> > "sites2", {projection: map.displayProjection, strategies:
> [new OpenLayers.Strategy.Fixed()], protocol: new
> OpenLayers.Protocol.HTTP({url: "data/siteswatr.gml", format: [new
> OpenLayers.Format.GML()]})});
> > map.addLayer(sites2);
>
> Your code looks correct to me. The Fixed strategy empties the layer
> before adding features into it, which could explain why you see one
> set of features only. I'd recommend adding a break point in the fixed
> strategy's merge() method to understand what's going on.
>
> >
> >
> >
>
> --
> Eric Lemoine
>
> Camptocamp France SAS
> Savoie Technolac, BP 352
> 73377 Le Bourget du Lac, Cedex
>
> Tel : 00 33 4 79 44 44 96
> Mail : eric.lemoine at camptocamp.com
> http://www.camptocamp.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090804/1773a232/attachment.html
More information about the Users
mailing list