[Geomoose-users] Draw LineString

Len Kne lkne at houstoneng.com
Thu Sep 23 19:54:10 EDT 2010


Currently, GeoMOOSE does not have a vector layer type defined, so you would not be able to add the layer through the Mapbook.  However, the approach you are taking should add the layer to OpenLayers and be displayed.  One thing I notice is you are defining "map", while GeoMOOSE already has a map object called "Map" (notice the upper-case "M".  I think if you were to add your layer to the Map object it should work.

Len
________________________________
From: Dante Fuster [dante.fuster at gmail.com]
Sent: Thursday, September 23, 2010 6:37 PM
To: geomoose-users at lists.sourceforge.net
Subject: [Geomoose-users] Draw LineString

Hey everyone,

I am trying to draw a linestring, i know the coordinates from GPS (in a database), and show in my map but nothing,  I try with OpenLayers  new Openlayers.Geometry.LinearRing ..., but i have probles with the MAP, how i get the map  or there are functions  in GeoMoose?

Anyone have some suggestions?

my test code is:

----------

print "<script>";

        print "<![CDATA[";
        print "map = new OpenLayers.Map('map');";
        print "var p = new OpenLayers.Geometry.Point(279496 ,8661317);
                                 GeoMOOSE.zoomToPoint(p.x,p.y,100);
                                 GeoMOOSE.addPopup(p.x,p.y,150,50,'<b>texto:</b> <br/> $textocalculado');";
        print "var layer_style = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']);";
        print "layer_style.fillOpacity = 0.2;";
        print "layer_style.graphicOpacity = 1;";
        print "var style_blue = OpenLayers.Util.extend({}, layer_style);";
        print "style_blue.strokeColor = 'blue';";
        print "style_blue.fillColor = 'blue';";
        print "style_blue.graphicName = 'star';";
        print "style_blue.pointRadius = 10;";
        print "style_blue.strokeWidth = 3;";
        print "style_blue.rotation = 45;";
        print "style_blue.strokeLinecap = 'butt';";
        print "var vectorLayer = new OpenLayers.Layer.Vector('Simple Geometry', {style: layer_style});";
        print "var pointFeature = new OpenLayers.Feature(p, null, style_blue);";
        print "var pointFeature2 = new OpenLayers.Feature(p, null, style_blue);";
        print "map.addLayer(vectorLayer);";
        print "vectorLayer.addFeatures([pointFeature,pointFeature2]);";
        print "]]>";
        print "</script>";
                print "</results>";




--------

Thanks,
Dante




More information about the Geomoose-users mailing list