[mapguide-users] Fusion vs react-layout

Jackie Ng jumpinjackie at gmail.com
Wed Nov 6 07:04:36 PST 2019


The code that was escaping my mind and sounded similar to what you're trying
to do was this example I wrote to demonstrate the enhanced viewer APIs
available to Task Pane content in mapguide-react-layout

https://github.com/jumpinjackie/mapguide-react-layout/blob/master/viewer/examples/taskpane/drawing.html

This example assumes points originate from a point digitization operation
(from a OL draw interaction). You should see through this example how vector
layers are added and how OL features are added to them.

Of particular interest to Task Pane content is the IMapViewer interface
documented here:

https://jumpinjackie.github.io/mapguide-react-layout/0.12.0/apidoc_npm/interfaces/_api_common_.imapviewer.html

The object returned by the new GetViewerInterface() method is in the shape
of the above interface. This object is your starting point for all
programmatic map viewer interaction for task pane content in
mapguide-react-layout.

Another API worth noting is the getOLFactory() method of IMapViewer.

https://jumpinjackie.github.io/mapguide-react-layout/0.12.0/apidoc_npm/interfaces/_api_common_.imapviewer.html#getolfactory

This is how you create OL objects (layers, sources, features, geometries,
etc) for any other viewer API that takes OL objects. You'll see major use of
this OL factory in the referenced example.

Hope that helps.

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html


More information about the mapguide-users mailing list