Re: [mapguide-users] Steps to query and zoom Mapguide layer on Fusion?
I am using MapGuide OS 2.4 >From the task Pane, i am doing as you recomended: var mapWidget = parent.Fusion.getWidgetById('Map'); var mapOL = mapWidget.oMapOL; var mgLayers = mapOL.getLayersByClass('OpenLayers.Layer.MapGuide'); var mapguideLayer = mgLayers[0] Everything ok till here, but when i do mapguideLayer.clearSelection(); it says thah object does not recognize function "clearSelection" I try replacing first line with: var mapWidget = window.top.Fusion.getWidgetById('Map'); with same result. BUt, i can call "clearSelection()" directly from mapWidget, as in mapWidget.clearSelection() But another functions I want to call, as simple as "getSessionId()" i can not found it in either variable. So. i must be doing something very wrong, but cant figure out what is it. -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Steps-to-query-and-zoom-Mapguide-layer-on-Fusion-tp4188529p5075254.html Sent from the MapGuide Users mailing list archive at Nabble.com. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
Re: [mapguide-users] Steps to query and zoom Mapguide layer on Fusion?
I am using MapGuide OS 2.4 >From the task Pane, i am doing as you recomend: var mapWidget = parent.Fusion.getWidgetById('Map'); var mapOL = mapWidget.oMapOL; var mgLayers = mapOL.getLayersByClass('OpenLayers.Layer.MapGuide'); var mapguideLayer = mgLayers[0] Everything ok till here, but when i do mapguideLayer.clearSelection(); it says thah object does not recognize function "clearSelection" I try replacing first line with: var mapWidget = window.top.Fusion.getWidgetById('Map'); with same result. BUt, i can call "clearSelection()" directly from mapWidget, as in mapWidget.clearSelection() But another functions I want to call, as simple as "getSessionId()" i can not found it in either variable. So. i must be doing something very wrong, but cant figure out what is it. -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Steps-to-query-and-zoom-Mapguide-layer-on-Fusion-tp4188529p5075253.html Sent from the MapGuide Users mailing list archive at Nabble.com. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
Re: [mapguide-users] Steps to query and zoom Mapguide layer on Fusion?
1) >From in the task pane: parent.zoomToExtents(minx,miny,maxx,maxy) In your template index.html: zoomToExtents: function (minx,miny,maxx,maxy) { var a = []; a[0] = parseFloat(minx); a[1] = parseFloat(miny); a[2] = parseFloat(maxx); a[3] = parseFloat(maxy); var mapWidget = Fusion.getWidgetById('Map'); mapWidget.setExtents(new OpenLayers.Bounds(a[0], a[1], a[2], a[3])); } 2) >From in the task pane: var mapWidget = parent.Fusion.getWidgetById('Map'); mapWidget.redraw(); 3) >From in the task pane: var mapWidget = parent.Fusion.getWidgetById('Map'); var mapOL = mapWidget.oMapOL; var mgLayers = mapOL.getLayersByClass('OpenLayers.Layer.MapGuide'); var mapguideLayer = mgLayers[0] mapguideLayer.clearSelection(); mapguideLayer.removeQueryLayer(); var mapDef = 'Library://mymap.MapDefinition' mapguideLayer.loadMap(mapDef); etc... Cheers, Kori Maleski On Wed, Mar 24, 2010 at 5:43 AM, Jose Cerrejon wrote: > > I goes crazy with this. Remember I'm newbie in the fascinating world of JS > OOP. > > Questions: > > 1) I've created a main.php inside taskpane (Fusion) without widget. Now I > want to call any function to query a layer in mapguide (inside taskpane in > Fusion) and zoomtoview. Any idea? > > 2) What's the magic frame to call the Refresh() function inside > MapguideViewer.js? (I'm calling from taskpane iframe) Tried windows.top, > windows.parent,... > > 3) Anybody can show me an example to make a call to any function in > Mapguide.js? > > Thks to think. > > -- > View this message in context: > http://n2.nabble.com/Steps-to-query-and-zoom-Mapguide-layer-on-Fusion-tp4790660p4790660.html > Sent from the MapGuide Users mailing list archive at Nabble.com. > ___ > mapguide-users mailing list > mapguide-users@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapguide-users > ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
[mapguide-users] Steps to query and zoom Mapguide layer on Fusion?
I goes crazy with this. Remember I'm newbie in the fascinating world of JS OOP. Questions: 1) I've created a main.php inside taskpane (Fusion) without widget. Now I want to call any function to query a layer in mapguide (inside taskpane in Fusion) and zoomtoview. Any idea? 2) What's the magic frame to call the Refresh() function inside MapguideViewer.js? (I'm calling from taskpane iframe) Tried windows.top, windows.parent,... 3) Anybody can show me an example to make a call to any function in Mapguide.js? Thks to think. -- View this message in context: http://n2.nabble.com/Steps-to-query-and-zoom-Mapguide-layer-on-Fusion-tp4790660p4790660.html Sent from the MapGuide Users mailing list archive at Nabble.com. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users