Hello!
I'm trying to add a dynamic layer from ESRI's sample server into
Google Earth using the GE api.
I know it's possible using the Google Maps API, but the api isn't the
same.
Any help or tips will be greatly appreciated!
Here's the simple code for Google Maps:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-
microsoft-com:vml">
<head>
<title>My Test</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/
>
<script src="
http://maps.google.com/maps?file=api&v=2&key=abcdefg"
type="text/javascript"></script>
<script src="
http://serverapi.arcgisonline.com/jsapi/gmaps/?v=1.4"
type="text/javascript" ></script>
<script type="text/javascript">
var gmap = null;
var dynamicMap;
function initialize() {
gmap = new GMap2(document.getElementById("gmap"));
var centerat = new GLatLng(0, 0);
gmap.addControl(new GLargeMapControl());
gmap.addControl(new GMapTypeControl());
gmap.setCenter(centerat, 1);
dynamicMap = new esri.arcgis.gmaps.DynamicMapServiceLayer
("
http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/
Demographics/ESRI_Population_World/MapServer");
}
function addDM (){
gmap.addOverlay(dynamicMap);
}
function removeDM (){
gmap.removeOverlay(dynamicMap);
}
</script>
</head>
<body onload="initialize();">
<div id="gmap" style="width: 500px; height:500px;"></div>
<input type="button" value="On" onclick="addDM();"/>
<input type="button" value="Off" onclick="removeDM();"/>
</body>
</html>