> What OpenLayers protocol settings can I use to pass the file contents to the
> OpenLayers GPX reader?
>
> This code works if I have one of the GPX files in my htdocs directory:
>
> var wgs84 = new OpenLayers.Projection("EPSG:4326");
> map.addLayer(new OpenLayers.Layer.Vector("GPX Vectors", {
> styleMap: gpxStyles,
> eventListeners: {
> "featuresadded": function(event) {
> // 'this' is layer
> this.map.zoomToExtent(this.getDataExtent());
> }
> },
> projection: wgs84,
> strategies: [new OpenLayers.Strategy.Fixed()],
> protocol: new OpenLayers.Protocol.HTTP({
> url: "deer 5-10-12.gpx",
> format: new OpenLayers.Format.GPX()
> })
> }));
>
> But I want to point the url to the file in memory of the client browser, or
> use some other approach.
I think you'd need to write a new OpenLayers.Protocol implementation
that uses the FileReader.readAsText(File) method
OpenLayers.Protocol.Script might have some pointers on how to implement that.
Mark
--
Disclaimer;
This message is just a reflection of what I thought at the time of
sending. The message may contain information that is not intended for
you or that you don't understand.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users