Fusion vs react-layout

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Fusion vs react-layout

pcardinal
This post was updated on .
with Fusion it was possible to access the map object in TaskPane.html with
the following code

var map = parent.Fusion.getWidgetById('Map');

and after it was possible to place a marker on the map

var olMap = map.oMapOL;
var oldmarkers = olMap.getLayersByName ( "Markers" );
if (oldmarkers[0] != undefined) {olMap.removeLayer(olMap.getLayer(oldmarkers[0].id))};
var markers = new parent.OpenLayers.Layer.Markers( "Markers" );
olMap.addLayer(markers);
var size = new parent.OpenLayers.Size(21,25);
var offset = new parent.OpenLayers.Pixel(-(size.w/2), -size.h);
var icon = new parent.OpenLayers.Icon('http://svrmgos/mapguide/fusion/widgets/taskpane/xx2.png', size, offset);
markers.addMarker(new parent.OpenLayers.Marker(pt,icon));
markers.addMarker(new parent.OpenLayers.Marker(pt,icon.clone()));




How to do the same with react-layout ?

In fact how can I call the function addoverlay() ?


--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
mapguide-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Fusion vs react-layout

Jackie Ng
I'm certain there is a way to do this in mapguide-react-layout, but the exact
code and APIs to do this escape me.

Let me cook up the right code sample and I'll post it here once I've figured
it out.

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Fusion vs react-layout

GordonL
On the same vein, how do we set the <Target>  with the react viewer?

I am porting the example in mapguide-rest where you can edit parcels, but
the tooltip hyperlinks are not targeting the TaskPane..

<http://osgeo-org.1560.x6.nabble.com/file/t195347/RESTDEMO-WITH-REACT.jpg>



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Fusion vs react-layout

Jackie Ng
I'm almost certain the problem here is that I haven't given the Task Pane
iframe a name (taskPaneFrame?), meaning your targeted tooltip links do
nothing when clicked.

Tracking: https://github.com/jumpinjackie/mapguide-react-layout/issues/1000

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Fusion vs react-layout

Jackie Ng
In reply to this post by pcardinal
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
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Fusion vs react-layout

Jackie Ng
In reply to this post by GordonL
0.12.5 release fixes this problem.

Btw, hyperlinks in tooltip content always should be targeting the task pane
frame. This aspect was not configurable in the older viewers, neither is it
configurable here.

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Fusion vs react-layout

Jackie Ng
In reply to this post by Jackie Ng
If you get the 0.12.6 release, it contains new methods in OL factory for
creating icon styles, which is what you need if you want to create point
features with icon/image symbology.

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: Fusion vs react-layout

pcardinal
This post was updated on .
Can you provide an example on how to use the new methods.  Thank you



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
mapguide-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapguide-users