To enable the display of terrain shaded relief data from Google, you need to add in the terrain map type to the Google Maps javascript code. Here are the steps to do it.
- Go to the GeoMedia WebMap Publisher created mashup folder, e.g. C:\GeoMediaWebMapProjects\mymashup\
- Change directory to the System folder.
- Use a text editor to open the file gm.js.
- Inside the text editor, locate the function initView.
- Look for the following lines in the function.
objMapViewEle = document.getElementById("map"); //testoutput("creating new custom map type");
var tileLayers = [new GTileLayer(new GCopyrightCollection(), 0, 18)];
var custommap = new GMapType(tileLayers, G_NORMAL_MAP.getProjection(), "No Backdrop",{errorMessage:"No Data Available"}); //testoutput("creating GMap2");
objMapView = new GMap2(objMapViewEle);
objMapView.addControl(new GLargeMapControl());
objMapView.addMapType(custommap);
objMapView.addControl(new GMapTypeControl());
gOverviewMapControl = new GOverviewMapControl(new GSize(150,150)); objMapView.addControl(gOverviewMapControl);
objMapView.addControl(new GScaleControl()); - Add in the following line in bold:
objMapView.addMapType(custommap); objMapView.addMapType(G_PHYSICAL_MAP); objMapView.addControl(new GMapTypeControl()); - Save and close the file gm.js.
- Now, open up the mashup web page in an Internet browser. You should be able to see the Terrain button. Clicking on the button will display the terrain data in the map window as shown in the screen shot below.
No comments:
Post a Comment