[mapguide-users] Re: google map integrated but need to on off the legend to put layer on original location

bjoseph82 brendajoseph82 at gmail.com
Mon Apr 4 01:40:43 EDT 2011


Sorry jackie,
i am using MapGuideOpenSource-2.2.0.4829-Beta1 and MapGuide Maestro
2.1.msi. what i did is edit the index.html. and did nothing at the
applicationdefinition.


1.  First add the google API with my API Key
(http://code.google.com/apis/maps/signup.html)
<script src='
http://maps.google.com/maps?file=api&amp;v=2.x&amp;key=ABQIAAAAERI0AKY9ZXkRvHnw-3vDJRREAmIJh_5fKSo01SOBdjF2gjz3TRR4Ei0yYkGUbuFlkwz0xMxxxxx
'></script>

2. Then modify the fusionInitialized function - the addGoogleStuff is a
function to add the google layer.
 mapWidget.registerForEvent(Fusion.Event.MAP_LOADED, addGoogleStuff);

3.  Finally, add the addGoogleStuff function.
var addGoogleStuff = function() {
    var mapWidget = Fusion.getWidgetById('Map');
    var map = mapWidget.oMapOL;
    mapWidget.fractionalZoom = false;
    map.setOptions({fractionalZoom: false, numZoomLevels: 80});
    var googleStreetsLayer = new OpenLayers.Layer.Google('Google Streets',
{type : G_NORMAL_MAP, isBaseLayer: true, sphericalMercator: true});
    map.addLayer(googleStreetsLayer);
    map.setBaseLayer(googleStreetsLayer);
 }

Where would i be wrong..
Regards.

On Mon, Apr 4, 2011 at 11:57 AM, Jackie Ng [via OSGeo.org] <
ml-node+6237259-836806893-325897 at n2.nabble.com> wrote:

> As a general rule, please *always* state the version of MapGuide you are
> using (and the installation environment/configuration if applicable)
>
> Now this is relevant to your question because commercial layer support
> varies depending on the version of MapGuide you are running. We need to know
> the version before anybody can give an actual answer.
>
> - Jackie
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://osgeo-org.1803224.n2.nabble.com/google-map-integrated-but-need-to-on-off-the-legend-to-put-layer-on-original-location-tp6237144p6237259.html
> To unsubscribe from google map integrated but need to on off the legend to
> put layer on original location, click here<http://osgeo-org.1803224.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=6237144&code=YnJlbmRham9zZXBoODJAZ21haWwuY29tfDYyMzcxNDR8LTE0NzU2MDM5NTY=>.
>
>


--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/google-map-integrated-but-need-to-on-off-the-legend-to-put-layer-on-original-location-tp6237144p6237356.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20110403/037bbd9b/attachment.html


More information about the mapguide-users mailing list