[mapguide-users] Fusion and Digitizing

GordonL gordon.luckett at arrowgeomatics.com
Thu Jan 29 16:47:54 EST 2009


Hi Mark,
I know what you mean about the sticky digitizing... I was told to look at
the 
resetCanvas function in the Measure.js file to get rid of that leftover
digitize graphics...but I haven't tried it yet...

gordon


Mark Pendergraft wrote:
> 
> I was in no way implying the wheel should be reinvented, in fact the
> code I posted was an example of how to use the MapGuideViewerAPI.js
> supplied DigitizePolygon(handler) function that you referred to.
> 
> I did say that I would like to see some method to clear the digitized
> shapes after the function's handler has been called.  In MGOS 1.2 after
> a polygon was digitized, it was destroyed.  In MGOS 2 with Fusion 1.1,
> the polygon stays on the map until the user closes their browser.
> 
> -Mark P.
> 
> -----Original Message-----
> From: mapguide-users-bounces at lists.osgeo.org
> [mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of GordonL
> Sent: Thursday, January 29, 2009 1:20 PM
> To: mapguide-users at lists.osgeo.org
> Subject: RE: [mapguide-users] Fusion and Digitizing
> 
> 
> You know, you really do not need to reinvent the wheel, if you have
> already
> built a lot of code with the Basic Web Layouts.  Did you know that
> Fusion
> supports some retro digitizing methods?
> For example, I put the following in an INVOKESCRIPT in the Flexible Web
> Layout:
> 
> top.parent.DigitizePoint(top.OnPointDigitized);
> 
> I also have the OnPointDigitized in a JS file attached to the main
> frame/window.  So I reuse my code for both FUSION and Basic Web
> Layouts...
> 
> Just check out the functions in the MapGuideViewerApi.js in the
> /www/fusion/MapGuide/ folder...
> They include:
> Refresh()
> SetSelectionXML(selectionXml)
> ZoomToView(x, y, scale, refresh)
> DigitizePoint(handler)
> DigitizeLine(handler)
> DigitizeLineString(handler)
> DigitizeRectangle(handler)
> DigitizePolygon(handler)
> 
> They work just like the classic MapGuide Viewer API...pretty sweet.
> 
> gordon
> 
> 
> 
> 
> Mark Pendergraft wrote:
>> 
>> Absolutely.
>> My biggest beef with digitizing in Fusion is that when you digitize an
>> object (point/polygon/etc.) it stays on the map.  The existing
> functions
>> don't have a clear method to remove the digitized object, and my
>> programming skills aren't good enough that I want to mess with it.
>> 
>> It's very simple,
>> Add a reference to MapGuideViewerApi.js and call DigitizePolygon()
>> 
>> The DigitizePolygon function requires that you pass it a handler
>> 
>> Something similar to the following:
>> 
>> DigitizePolygon(CreateJobByPolygon);  
>> 
>> function CreateJobByPolygon(polygon) {
>>     var geomText = polygon.Count;
>>     for (var i = 0; i < polygon.Count; i++){
>>         geomText += "," + polygon.Point(i).X + "," +
> polygon.Point(i).Y;
>>     }
>>     Fusion.getWidgetById('Map').setCursor('auto');
>> //	here you would send your geomText to a web service, or aspx page
>> that would turn the coordinates into a linear ring
>> //    and then a polygon from there.  The geomText variable (in this
>> particular situation) evaluates to something similar to 
>> //    3,5000.00,5000.00,5050.00,5050.00,5100.00,5100.00
>> }
>> 
>> 
>> Of course you can format the way the coordinates are sent to your
>> application any way you want.
>> 
>> I would also recommend calling the DigitizePolygon() function from an
>> InvokeScript() widget, as I had some problems when I tried to actually
>> create a widget and call it from there.  Also, I prefer to change my
>> cursor when the widget is activated, you can see I put it back to
> 'auto'
>> in the CreateJobByPolygon() function, but I like to set it to
>> 'crosshair' before the DigitizePolygon function is called.
>> 
>> -Mark P.
>> 
>> -----Original Message-----
>> From: mapguide-users-bounces at lists.osgeo.org
>> [mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Stefan
>> Dalakov
>> Sent: Friday, January 23, 2009 12:35 PM
>> To: MapGuide Users Mail List
>> Subject: [mapguide-users] Fusion and Digitizing
>> 
>> Hi all,
>>  From what I read here, should I conclude that digitizing functions in
> 
>> Fusion are not yet fully supported ?
>> I need to digitize a polygon on the map and save it permanently. I
> have 
>> this working with AJAX viewer, but would like to port it to Fusion
>> Has anyone succeeded to  do this ?
>> 
>> Stefan Dalakov
>> 
>> 
>> _______________________________________________
>> mapguide-users mailing list
>> mapguide-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>> _______________________________________________
>> mapguide-users mailing list
>> mapguide-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>> 
>> 
> 
> -- 
> View this message in context:
> http://n2.nabble.com/Fusion-and-Digitizing-tp2205560p2241352.html
> Sent from the MapGuide Users mailing list archive at Nabble.com.
> 
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> 
> 

-- 
View this message in context: http://n2.nabble.com/Fusion-and-Digitizing-tp2205560p2241485.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list