[OpenLayers-Users] Problem in displaying GML layer

Frank Broniewski brfr at metrico.lu
Tue Dec 9 09:00:12 EST 2008


On Tuesday 09 December 2008 11:36:54 S.Reena wrote:
> Hi All,
>
> I want to upload gpx file on my map but its giving error that it cannot be
> displayed. I am attaching my gpx file with this
>
> map.addLayer(new OpenLayers.Layer.GML("GPX", "gpx/mygps.gpx",
>                {
>                 format: OpenLayers.Format.GPX,
>                 formatOptions:{ extractWaypoints:true,
>                                 extractTracks:true,
>                                 extractRoutes:true,
>                                 extractAttributes:true
>                                 }
>                }));
>
> http://www.nabble.com/file/p20912231/mygps.gpx mygps.gpx
>
> Thanks in advance :)
>
> Cheers,
> Reena.

Hi Reena,

I can't see anything wrong with your layer definitions, I am basically using 
the same. Did you check your permissions on the gpx file (read)? Is the path 
correct? Did you check if your gpx file is valid?
I am using the definition below, maybe it helps you.

Frank

	pt = new OpenLayers.Layer.GML (
				"Informationen",
				"http://clydeswelt.frabron.de/kml/wpt.gpx",
				{								
					projection: new OpenLayers.Projection("EPSG:4326"),
					format: OpenLayers.Format.GPX,
					styleMap: ptStyle,
					formatOptions: {
						extractWaypoints: true,
						extractTracks: false,
						extractRoutes: false,
						extractAttributes: true	
					}
				}
			);

-- 
Frank Broniewski

Metrico s.àr.l. ( http://www.metrico.lu )
36, rue des Romains 
L-5433 Niederdonven 
Luxembourg

Fon: +352 26 74 94 28 
Fax: +352 26 74 94 99



More information about the Users mailing list