Hi Yatzek,

I suppose your multilinestring is in degree projection, right? And you
want to use Google Maps as a background, which has a projection in meter
(epsg:900913). This could be a reason why it doesn't work.

Daniel


Yatzek schrieb:
> Hi
>
> Could anyone point me to a good example on how can I display a 
> multilinestring in openlayers?
>
> I used the code from pgRouting example, but is does now work (with some 
> modifications), here is a part of my javascript:
>
> // routeStyle is defined as a red line
> redRoute = new OpenLayers.Layer.Vector(" Route ", {style: routeStyle});
>
> parser = new OpenLayers.Format.WKT();
> var wkt = " MULTILINESTRING((-0.0299018 51.4500794,-0.0299125 
> 51.4498053,-0.0298696 51.4495245,-0.0298696 51.4493774))"
> var geometry = parser.read(wkt);
>
> var feature = new OpenLayers.Feature.Vector(geometry);
>
> redRoute.addFeatures(feature);
>
> function init(){
>            
> // map is diplayed in element id = "map"
>                 map = new OpenLayers.Map(document.getElementById("map"));
>                 var goog= new OpenLayers.Layer.Google("Google ");
>                 map.addLayers([goog,markers, redRoute]);
> }
>
> Please c could you help me and explain what is wrong?
>
> Thanx
>
> Yatzek
>
>
> _______________________________________________
> Routing mailing list
> [email protected]
> http://lists.openstreetmap.org/listinfo/routing
>
>   


_______________________________________________
Routing mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/routing

Reply via email to