Google Earth as Base layer

1540
2
01-22-2013 08:08 PM
ReddaiahPurma
New Contributor
Is it Possible to add Google Earth as baselayer using ArcGIS API for Javascript ?

I have gone through ArcGIS Extension for Google Maps Api...where i can add google Earth plugin to map...(GMap2)

But what i need is to use the same plugin in ArcGIS API for Javascript (esri.map)
0 Kudos
2 Replies
NianweiLiu
Occasional Contributor II
Is it Possible to add Google Earth as baselayer using ArcGIS API for Javascript ?


Yes, you can implement a subclass of layer and use layerContainer as container, then embeded an instance of google earth plug in using Earth API. Because earth is a 3D visualization, there are some limitations. You will have to convert all your Graphics layer's feature into KML based objects, and you may not use any of the tiled map services in your existing map. For dynamic map services you would likely convert them to ground overlay and refresh as view point changes. On top of that you may need use the iframe shim technique to embed the plug in to your page.
0 Kudos
ReddaiahPurma
New Contributor
Yes, you can implement a subclass of layer and use layerContainer as container, then embeded an instance of google earth plug in using Earth API. Because earth is a 3D visualization, there are some limitations. You will have to convert all your Graphics layer's feature into KML based objects, and you may not use any of the tiled map services in your existing map. For dynamic map services you would likely convert them to ground overlay and refresh as view point changes. On top of that you may need use the iframe shim technique to embed the plug in to your page.


Using Arcgis api for Javascript i have done some tools where i am showing my services on the google maps.....
But what i need now is,along with google maps i have to add EARTH as well.
If i go with ArcGIS extension for Google Maps or Google Earth API...i need to change my code completely..because using this i can only use kml or kmz data...
But instead of that is there any way to use Google Earth API as a layer to esri.map object in ArcGIS api for Javascript..

I have tried the below mentioned code...But here if i zoom or pan the base layer remains constant..only they are working on front layers....

<!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>ArcGIS</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAoCCuxJYvQKuOME9a3Fc8KhS3iegp0cxLQXAJedXkaj3wQFFtEhTesTSfWOBzZ-EKH79ER3PXZ-lnhA" type="text/javascript"></script>
<script src="http://serverapi.arcgisonline.com/jsapi/gmaps/?v=1.6" type="text/javascript" ></script>
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.2"></script>

<script type="text/javascript">
function initialize() {
 gmap = new GMap2(document.getElementById("gmap"));
var centerat = new GLatLng(22.00, 77.00);
gmap.addControl(new GLargeMapControl());
 gmap.addControl(new GOverviewMapControl());
  gmap.addControl(new GScaleControl());
 gmap.addControl(new GMapTypeControl());
  gmap.setCenter(centerat, 4);
 gmap.enableScrollWheelZoom();   
gmap.addMapType(G_SATELLITE_3D_MAP);
 gmap.setMapType(G_SATELLITE_3D_MAP);

var map = new esri.Map("gmap");
var mapservicelayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://0.0.0.0(myliveip)/ArcGIS/rest/services/javatest/admin_boundries/MapServer",{"opacity":0.75});
map.addLayer(mapservicelayer);
}
</script>
</head>

<body onload="initialize();" onunload="GUnload();">
<div id="gmap" style="width: 100%; height:550px;"></div>
</body>
</html>

0 Kudos