[mapguide-users] GoogleMap on MGOS

ar_gaeta ar_gaeta at yahoo.it
Mon Nov 8 12:16:42 EST 2010


Hi,
I have a problem loading a GoogleMap layer on my flexible layout on MGOS
v2.2.
In a lot of forum I've got a lot of solution but they didn't work for me.
Or, better, I'm losing something on the way.
The 2 solutions proposed:

1-http://trac.osgeo.org/fusion/wiki/MapGuideCommercialOverlays
2-http://research.dmsolutions.ca/?p=314

Here I put the first part of my ApplicationDefinition, and the string added
to my "index.html" of the weblayout template (in my case, I've tried on
slate):

ApplicationDefinition - row changed:

<MapSet>
    <MapGroup id="googleBase">
      <Map>
        <Type>MapGuide</Type>
        <SingleTile>true</SingleTile>
        <Extension>
          <Options>
            <isBaseLayer>false</isBaseLayer>
            <userOverlay>true</userOverlay>
            <projection>EPSG:900913</projection>
          </Options>
         
<ResourceId>Library://prova_basic/Map/mappa-google.MapDefinition</ResourceId>
        </Extension>
      </Map>
      <Map>
        <Type>Google</Type>
        <SingleTile>false</SingleTile>
        <Extension>
          <ResourceId>google</ResourceId>
          <Options>
            <type>G_SATELLITE_MAP</type>
          </Options>
        </Extension>
      </Map>
    </MapGroup>
  </MapSet>

Index.html - row added:

<script
src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=true&amp;key=ABQIAAAAJPK2JAvznfdLjCCKOo0--RRv5cmsqmyFG_VJkA8rJhF-J1gmJBSIK-D-YjT4JQNWaLbsvp5rqNEHbQ"
type="text/javascript"></script>

<script type="text/javascript"
src="../../../lib/fusionSF-compressed.js"></script>
<script type="text/javascript"
src="http://127.0.0.1:8008/mapguide/fusion/lib/fusion.js"></script>
<script type="text/javascript"
src="http://www.openlayers.org/api/OpenLayers.js"></script>
<script type="text/javascript"
src="http://127.0.0.1:8008/mapguide/fusion/layers/MapGuide/MapGuideViewerApi.js"></script>

var addGoogleStuff = function() {

    var mapWidget = Fusion.getWidgetById('Map');
    var map = mapWidget.oMapOL;
    mapWidget.fractionalZoom = false;        //fractionalZoom not permitted
with Google layers
    map.setOptions({fractionalZoom: false, numZoomLevels: 30});

    // Create a Google streets layer
    var googleStreetsLayer = new OpenLayers.Layer.Google('Google Streets',
{type : G_NORMAL_MAP, isBaseLayer: true, sphericalMercator: true});
    map.addLayer(googleStreetsLayer);

    var mgLayers = map.getLayersByClass('OpenLayers.Layer.MapGuide');
    if(mgLayers.length != 0)
    {
        var mgLayer = mgLayers[0];
        if(mgLayer.isBaseLayer)
        {
            map.setBaseLayer(googleStreetsLayer);
            mgLayer.setIsBaseLayer(false);
            mgLayer.setVisibility(true);
        }
    } 
} 

When I load my layout nothing happen, just I can see the various frames of
the pages but they are empty.
With the "searcher bug" of GoogleChrome I've found that "map.js": "canno't
read property "maps" of undefined".

Someone can help me please?

Tnx in advance,
Riccardo


-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/GoogleMap-on-MGOS-tp5717706p5717706.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list