Placing a dynamic marker

Tamas Szekeres szekerest at GMAIL.COM
Tue Sep 19 12:06:40 EDT 2006


Hi,

Here is a sample to create inline symbols:

            mapObj myMap = new mapObj();
            layerObj myLayer = new layerObj(myMap);

            symbolObj symbol = new symbolObj("mySymbol", null);
            symbol.type = (int)MS_SYMBOL_TYPE.MS_SYMBOL_VECTOR;
            symbol.filled = mapscript.MS_TRUE;
            lineObj line = new lineObj();
            line.add(new pointObj(1, 5, 0, 0));
            line.add(new pointObj(1, 3, 0, 0));
            line.add(new pointObj(3, 2, 0, 0));
            line.add(new pointObj(1, 1, 0, 0));
            line.add(new pointObj(1, 3, 0, 0));
            symbol.setPoints(line);
            symbol.sizex = 10;
            symbol.sizey = 10;

            myMap.symbolset.appendSymbol(symbol);

            classObj classtest = new classObj(myLayer);
            classtest.name = "test";

            styleObj myStyle = new styleObj(classtest);
            myStyle.symbolname = "mySymbol";
            myStyle.symbol = myMap.symbolset.index("mySymbol");
            myStyle.size = 150;
            myStyle.color = new colorObj(255, 0, 0, 1);


For adding features to the layer:

            shapeObj shp = new shapeObj(MS_SHAPE_TYPE.MS_SHAPE_POINT);
            lineObj line = new lineObj();
            line.add(new pointObj(x,y,0,0));
            shp.add(line);
            myLayer.addFeature(shp);


Best Regards,

Tamas Szekeres


2006/9/19, Brian Krebs <brian.krebs at korterra.com>:
>
>
>
>
> I'm developing in C#/ASP.Net.  I'm using setextent to zoom to a specific
> lat/long by adding or subtracting 0.002 from the lat/long values to get my
> min and max X and Y values.  What I need help with is using that lat/long
> position to place a pinpoint or some other similar marker.  Or, after
> calling setextent, placing a marker in the very center of the returned map
> image(which should match my lat/long position).  I also need this marker to
> remain visible and placed accordingly when the user zooms, pans or goes to
> full extent.
>
>
>
> Thanks in advance for any help you can provide.
>
>
>
> Brian Krebs
>
>



More information about the mapserver-dev mailing list