[mapguide-users] Kaliopa mobile viewer with google maps as base layer

RenoSun renolionheart at gmail.com
Sat Jun 27 16:48:47 PDT 2015


Hi Rodolfo,

You should be able to find initwms() function under Defaults.aspx.

Then, you can add following codes.

var GoogleSatellite = new OpenLayers.Layer.OSM("Google Satellite",
["http://mt1.google.com/vt/lyrs=y&x=${x}&y=${y}&z=${z}"], { numZoomLevels:
23, sphericalMercator: true,transitionEffect: 'resize' });

var GoogleStreet = new OpenLayers.Layer.OSM("Google Street",
["http://mt1.google.com/vt/x=${x}&y=${y}&z=${z}"], { numZoomLevels: 23,
sphericalMercator: true,transitionEffect: 'resize' });

There are a lots of based map options.

Nokia Here:
http://1.aerial.maps.cit.api.here.com/maptile/2.1/maptile/newest/satellite.day/${z}/${x}/${y}/256/png8?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg

Bing Map:
var aerial = new OpenLayers.Layer.Bing({
                key: "APIKEY",
                type: "Aerial",
                name: "Bing",
                numZoomLevels: 23, 
                sphericalMercator: true,
                transitionEffect: 'resize'            
});

Other Openlayers Options:

//Water Color
var wc = new OpenLayers.Layer.OSM("Water Color",
["http://d.tile.stamen.com/watercolor/${z}/${x}/${y}.jpg"], { numZoomLevels:
23, sphericalMercator: true,transitionEffect: 'resize' });

//Bicycle
var bc = new OpenLayers.Layer.OSM("Bicycle",
["http://b.tile.thunderforest.com/cycle/${z}/${x}/${y}.png"], {
numZoomLevels: 23, sphericalMercator: true,transitionEffect: 'resize' });

//Transport
var transp = new OpenLayers.Layer.OSM("Transport",
["http://b.tile.thunderforest.com/transport/${z}/${x}/${y}.png"], {
numZoomLevels: 23, sphericalMercator: true,transitionEffect: 'resize' });

Also, you can set the initial visibility of each based map.

Example:
            wc.setVisibility(false);
            bc.setVisibility(false);
            transp.setVisibility(false);
            toner.setVisibility(false);

Finally, add following code to add all the based map layers into the map.

map.addLayers([GoogleSatellite,GoogleStreet, wc, bc ,transp, toner]);

Let me know if you have other questions.










--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Kaliopa-mobile-viewer-with-google-maps-as-base-layer-tp5212543p5213262.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list