I wasn't adding the layer switcher to my map because I had hoped to add the layers in the Legend Widget. When I add the LayerSwitcher Google layers show up, but they are zoomed to the extent of the entire map (aka entire world). I would pursue setting them at the correct extents, but Paul informs me that Fusion 2.0 Beta will be arriving shortly with support for any OpenLayers Layer type. I have a lot of work to do on my Fusion map in the meantime so I'll put this off until the Beta comes out. Thanks for your help. -Mark P.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Zac Spitzer Sent: Wednesday, January 07, 2009 5:32 PM To: MapGuide Users Mail List Subject: Re: [mapguide-users] Adding OpenLayers.Layer to Fusion Map your going to need to dive into the whole projection and OL spherical mercator stuff I'm prety sure the google layers will be added as what's called a base layer in OL which means they won't be displayed by default does the layer switcher show up? z On Thu, Jan 8, 2009 at 7:27 AM, Mark Pendergraft <[email protected]> wrote: > I would like to add an OpenLayers.Layer (specifically google maps) to my > MGOS Fusion Layout. I've been looking through the posts and there is a lot > of info regarding both of these but I'm at a loss as to how to implement it > with Fusion. > > I can get the OpenLayers map using the following code > > var mapWidget = Fusion.getWidgetById('Map'); > > var olmap = mapWidget.oMapOL; > > > > and on a separate page that I made I can implement google into openlayers > using the following script: > > > > map = new OpenLayers.Map('map'); > > map.addControl(new OpenLayers.Control.LayerSwitcher()); > > var gphy = new OpenLayers.Layer.Google( > > "Google Physical", > > {type: G_PHYSICAL_MAP} > > ); > > var gmap = new OpenLayers.Layer.Google( > > "Google Streets", // the default > > {numZoomLevels: 20} > > ); > > var ghyb = new OpenLayers.Layer.Google( > > "Google Hybrid", > > {type: G_HYBRID_MAP, numZoomLevels: 20} > > ); > > var gsat = new OpenLayers.Layer.Google( > > "Google Satellite", > > {type: G_SATELLITE_MAP, numZoomLevels: 20} > > ); > > map.addLayers([gphy, gmap, ghyb, gsat]); > > map.setCenter(new OpenLayers.LonLat(10.2, 48.9), 5); > > > > But I'm not sure how to implement both together. When I add the google > layers to the olMap, nothing breaks but my normal Fusion layout shows up. > > I'm looking for a push in the right direction here, or a link to an example > that I can explore. The end goal is to have my normal Fusion map with > google as a layer which can be turned on/off in the legend widget. > > I'm assuming that I will have to access openlayers via > Fusion.getWidgetById('Map').olMap; and add the openlayers.layer to the > olMap. But then how do I register those layers with the mapWidget in order > for them to show up. Also, I'm assuming that I will have to set some type > of bounds or coordinate conversion for the google layers to know where they > are on my map, seeing as my map is on a state plane coordinate system > instead of lat/long. > > Thanks for the help > > -Mark P. > > _______________________________________________ > mapguide-users mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/mapguide-users > > -- Zac Spitzer - http://zacster.blogspot.com +61 405 847 168 _______________________________________________ mapguide-users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/mapguide-users _______________________________________________ mapguide-users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/mapguide-users
