[mapguide-dev] how to draw a polygon and save it?

Kencana bluesky_dyx at hotmail.com
Thu Nov 30 03:59:45 EST 2006


Hi,

do you have any sample source code of creating the polygon?
I have tried to pass the x and y value however,
it didnt return the whole points value.
it only returns the first point value.
any idea of this?
Thank you

Regards,
Kencana

Jason Birch wrote:
> 
> Hi,
> 
> You will probably get better response on the "users" list.  The "dev"
> list is for developers working directly on the MapGuide code.
> 
> As far as I've seen, there is no direct equivalent to the redlining
> functions, especially in the area of per-feature styling.  It does look
> like you could roll your own with a bit of work.
> 
> Have a look at the Digitize functions in the Map Frame section of the
> Viewer API:
> https://mapguide.osgeo.org/nonav/docs/viewerapi/viewerapi.html#mapframe
> 
> From these, you would deal with the returned feature in JavaScript,
> probably something that uses the Form frame's "Submit" method.  You may
> need to somehow serialize the geographic object before sending it to the
> form as a parameter.
> 
> In the form handler, you would need to create/reference a redlining
> layer on the map.  The developer's guide provides information on working
> with layers, and some code samples; the file layer_functions.php is
> useful.
> 
> You will also need code that adds the redlining objects to data source
> referenced by this layer.  You can add the features by either connecting
> directly and using SQL, or through the FeatureService
> https://mapguide.osgeo.org/nonav/docs/webapi/d5/d10/class_mg_feature_ser
> vice.html
> 
> As far as per-feature symbology goes, the only workaround I can see
> would be to have a layer for each feature.  The general process would
> look something like this:
> 
> - Create a new layer "group" for redlining
> - Create the feature (have a look at MgInsertFeatures in the
> FeatureService API) returning the ID of the created feature
> - Create a layer that:
>   - is not shown in the menu
>   - has the redlining group as its parent
>   - uses the desired symbology
>   - references the specific feature ID of the newly-created object
> 
> Not sure how performant this would be though...
> 
> Jason
> 
> -----Original Message-----
> From: Li Wang [mailto:*********@yahoo.com] 
> Sent: Saturday, May 27, 2006 08:03
> Subject: [mapguide-dev] how to draw a polygon and save it? 
> 
> Hi, I just move to Mapguide enterprise from MG6.5. I want to draw a few
> lines and polygons and save them to a database. I do these easily in
> MG6.5 by using redline functions. How can I do it in MGE? any help will
> be appreciated.
> 
> Li Wang 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
> For additional commands, e-mail: users-help at mapguide.osgeo.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/RE%3A--mapguide-dev--how-to-draw-a-polygon-and-save-it--tf1700929.html#a7615793
Sent from the MapGuide Users mailing list archive at Nabble.com.





More information about the Mapguide-users mailing list