[ZS2] [mapguide-users] Draw Point From Invoke Script n c# script

Kenneth Skovhede, GEOGRAF A/S ks at geograf.dk
Wed Jan 21 03:09:07 EST 2009


A very simple way, would be to place an <img> tag with a marker on the page.
Then use the viewer API methods to calculate the pixel position that 
corresponds to
the point center, and place the image there.

You need to re-position the <img> tags when the map pans or zooms.

The more generic approach, is to use the same method as used for buffering:
1. Create a temporary FeatureSource with an SDF file
2. Insert a feature (point, line or polygon) into the FeatureSource
3. Create a temporary LayerDefinition that displays the FeatureSource
4. Insert the layer in the runtime map
5. Refresh the map on the client

The second example is preferable if you have more than just a point.
Code for all of it can be found with the "buffer*.aspx/php/jsp" files
in the mapviewer folder of your MapGuide installation.

Regards, Kenneth Skovhede, GEOGRAF A/S



ajid skrev:
> i have 2 situations
> 1) I invoke script " ZoomToView(101.657487, 3.161049, 26432.77, true); "
> then how i just draw a point? anyone can help me??
>
> 2) My file :  http://n2.nabble.com/file/n2190486/getlatlong.aspx
> getlatlong.aspx  and  http://n2.nabble.com/file/n2190486/gotopoint.aspx
> gotopoint.aspx  , i have 3 text field : X,Y and scale.. i can get the centre
> of map when i clicked get a result.. how i wanna draw a point that point i
> insert on 3 textfield..
>
> Thanx
>
> -----
> ::: PublicVisitor :::
> www.myguidepages.com
>   


More information about the mapguide-users mailing list