[mapguide-users] Adding OpenLayers.Layer to Fusion Map

Zac Spitzer zac.spitzer at gmail.com
Wed Jan 7 20:31:41 EST 2009


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 <markp at meadgilman.com> 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
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
>



-- 
Zac Spitzer -
http://zacster.blogspot.com
+61 405 847 168


More information about the mapguide-users mailing list