POST
|
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>
... View more
01-23-2013
08:30 PM
|
0
|
0
|
274
|
POST
|
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)
... View more
01-22-2013
08:08 PM
|
0
|
2
|
1526
|
POST
|
The above code is working for me....Please find the below code...May be there is a problem with your geometry service.i have just used my service in your code and its working fine..... <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<title>
Measure Tool
</title>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.8/js/dojo/dijit/themes/claro/claro.css">
<style type="text/css">
html,body {
height:100%;
width:100%;
margin:0;
}
body {
background-color:#FFF;
overflow:hidden;
font-family:"Trebuchet MS";
}
#map {
border:solid 2px #808775;
-moz-border-radius:4px;
-webkit-border-radius:4px;
border-radius:4px;
margin:5px;
padding:0px;
}
#titlePane{
width:240px;
}
.claro .dijitTitlePaneTitle {
background: #808775;
font-weight:600;
border:solid 1px #29201A;
}
.claro .dijitTitlePaneTitleHover {
background:#808775;
}
.claro .dijitTitlePaneTitleActive {
background:#808775;
}
.claro .dijitTitlePaneContentOuter {
border-right: solid 2px #808775 !important;
border-bottom: solid 2px #808775 !important;
border-left: solid 2px #808775 !important;
}
</style>
<script type="text/javascript">
var djConfig = {
parseOnLoad:true
};
</script>
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.8"></script>
<script type="text/javascript">
dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.TitlePane");
dojo.require("dijit.form.CheckBox");
dojo.require("esri.map");
dojo.require("esri.dijit.Measurement");
dojo.require("esri.SnappingManager");
dojo.require("esri.dijit.Scalebar");
dojo.require("esri.layers.FeatureLayer");
var map;
function init() {
debugger;
esri.config.defaults.io.proxyUrl = "proxy.jsp";
//esri.config.defaults.map.sliderLabel = null;
esri.config.defaults.io.alwaysUseProxy = false;
//This sample may require a proxy page to handle communications with the ArcGIS Server services. You will need to
//replace the url below with the location of a proxy on your machine. See the 'Using the proxy page' help topic
//for details on setting up a proxy page.
//esri.config.defaults.io.proxyUrl = "/arcgisserver/apis/javascript/proxy/proxy.ashx";
//esri.config.defaults.io.alwaysUseProxy = false;
//This service is for development and testing purposes only. We recommend that you create your own geometry service for use within your applications
//esri.config.defaults.geometryService = new esri.tasks.GeometryService("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
esri.config.defaults.geometryService = new esri.tasks.GeometryService("http://10.1.0.24/ArcGIS/rest/services/Geometry/GeometryServer");
var initExtent= new esri.geometry.Extent({ "xmin": 5410208.1629469395, "ymin": -232058.21480738267, "xmax": 14215753.821396902, "ymax": 5638305.557492592, "spatialReference": { "wkid": 102100} });
map = new esri.Map("map", {
extent: initExtent, wrapAround180: true, nav: false,logo:false
});
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");
map.addLayer(basemap);
//var initialExtent = new esri.geometry.Extent({"xmin":-9545482,"ymin":4615382,"xmax":-9544248,"ymax":4616059,"spatialReference":{"wkid":102100}});
//map = new esri.Map("map", {
//extent:initialExtent
// });
dojo.connect(map, 'onLoad', function(map) {
//resize the map when the browser resizes
dojo.connect(dijit.byId('map'), 'resize', map,map.resize);
});
/*var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer");
map.addLayer(basemap);
var sfs = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,
new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,
new dojo.Color([195,176,23]), 2),null);
var parcelsLayer = new esri.layers.FeatureLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_LandRecords_Louisville/MapServer/0", {
mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
outFields: ["*"]
});
parcelsLayer.setRenderer(new esri.renderer.SimpleRenderer(sfs));
dojo.connect(map, "onLayersAddResult", function(results){
//dojo.keys.copyKey maps to CTRL on windows and Cmd on Mac.
var snapManager = map.enableSnapping({snapKey:dojo.keys.copyKey});
var layerInfos = [{layer: parcelsLayer}];
snapManager.setLayerInfos(layerInfos);*/
var measurement = new esri.dijit.Measurement({
map: map
}, dojo.byId("measurementDiv"));
measurement.startup();
//});
//map.addLayers([parcelsLayer]);
}
//show map on load
dojo.addOnLoad(init);
</script>
</head>
<body class="claro">
<div id="mainWindow" data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design:'headline',gutters:'false'"
style="width:100%; height:100%;">
<div id="map" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'">
<div style="position:absolute; right:20px; top:10px; z-Index:999;">
<div id="titlePane" data-dojo-type="dijit.TitlePane" data-dojo-props="title:'Measurement', closable:'false', open:'false'"
style="min-width: 200px;">
<div id="measurementDiv">
</div>
<span style="font-size: smaller; padding: 5px 5px;">Press <b>CTRL</b> to enable snapping.</span>
</div>
</div>
</div>
</div>
</body>
</html>
... View more
10-29-2012
02:52 AM
|
0
|
0
|
159
|
POST
|
Thanks for the response.............. Is there any other way to do this without using GP Service ?
... View more
10-21-2012
08:38 PM
|
0
|
0
|
270
|
POST
|
Can we achieve it by creating any gp service.If so please give me some idea about that....Il pass the map server and field name based on which i need to analyse and return feature polygons with geo statistical analysis data to show on map...similar to that in Arcgis desktop
... View more
10-17-2012
09:57 PM
|
0
|
0
|
270
|
POST
|
Is there any way to achieve Interpolation similar to IDW using ArcGIS Javascript api.... Suppose if there is rainfall data at some Known locations i need to do Geo Statistical Analysis and display that on map using arcgis Javascript api
... View more
10-17-2012
08:06 PM
|
0
|
4
|
614
|
POST
|
My ArcGIS Server Version is 10.0 .Is there any way to print the local services using JS API.Is there any samples related to that.I have tried the samples provided with API..........But it shows print button again......
... View more
08-21-2012
10:28 PM
|
0
|
0
|
443
|
POST
|
May b this will help you... Buffer along Selected Feature with two distances.................. Code in attachment........ <div id="FeatureIntersectBufferdialog" title="Query Intersect Buffer" style="display: none;"> <div id="FeatureIntersectd"> <table cellspacing="0" cellpadding="3" border="0" width="100%" height="100%"> <tr> <td width="180px;"> <span style="font-weight:bold;" >Select Main Service </span> </td> <td width="200px;"> <select id="FIBService" style="width:180px;" onchange="FIBMainDrpServiceChange();" ></select> </td> </tr> <tr> <td width="180px;"> <span style="font-weight:bold;" >Select Main Layer </span> </td> <td width="200px;"> <select id="FeatureIntersectdrp" style="width:180px;"></select> </td> </tr> <tr> <td width="180px;"> <span style="font-weight:bold;" >Buffer Distances </span> </td> <td width="200px;" style="padding:3px;"> <input type="text" id="distanceIntersectFeatureBuffer" size="5" value="10" style="width:80px;" /> <input type="text" id="distanceIntersectFeatureBuffer0" size="5" value="100" style="width:80px;"/><br/> <select id="unitIntersectFeatureBuffer" style="width:180px;"> <option value="UNIT_STATUTE_MILE">Miles</option> <option value="UNIT_FOOT">Feet</option> <option value="UNIT_KILOMETER">Kilometers</option> <option value="UNIT_METER">Meters</option> <option value="UNIT_NAUTICAL_MILE">Nautical Miles</option> <option value="UNIT_US_NAUTICAL_MILE">US Nautical Miles</option> <option value="UNIT_DEGREE">Degrees</option> </select> </td> </tr> <tr> <td width="180px;"> <span style="font-weight:bold;" >Select Intersection Service </span> </td> <td width="200px;"> <select id="FIBInterService" style="width:180px;"></select> </td> </tr> <tr> <td width="180px;"> </td> <td width="200px;"> <button onclick="clrGraphics(map);initFuntionalityFeatureIntersecttBuffer(map);" dojotype="dijit.form.Button"> Submit</button> <button onclick="clrGraphics(map);" dojotype="dijit.form.Button"> Clear</button><br /> <span style="font-style:italic;" >Click on Map after Submit...</span> </td> </tr> <tr> <td width="180px;"> <span style="font-weight:bold;" >select Affected Layer</span> </td> <td width="200px;"> <select id="FeatureIntersectdrpAffectedLayer" style="width:180px;"></select> <br /> <button onclick="clrGraphics(map);initGetFeatureFeatureIntersectBuffer(map);" dojotype="dijit.form.Button"> Get Features</button> </td> </tr> <tr> <td colspan="2" ><br /><span style="font-style:italic;" id="messagesFeatureIntersect"></span> </td> </tr> </table><div id="FeatureIntersectPost" dojotype="dijit.layout.ContentPane" title="Feature Buffer Results" ></div> </div> </div>
... View more
08-17-2012
11:29 PM
|
0
|
0
|
249
|
POST
|
You can detect when a layer is added to the map by listening for map.onLayerAdd(). You can then refresh the legend using legend.refresh(). The TOC probably has an equivalent refresh method. Steve Thanq Steve..... I have fixed that for Legend but for TOC i cant find any refresh method.... var inltoc=dijit.byId("inlineDiv"); inltoc.layerInfos=layerInfocv; By this i am able to bind new Layers to TOC but unable to reflect that in "inlineDiv"
... View more
08-06-2012
10:05 PM
|
0
|
0
|
175
|
POST
|
Is it possible to rebind or refresh agsjs.dijit.TOC and esri.dijit.Legend if i add an additional Service dynamically after loading the complete map page along with TOC and Legend.....
... View more
08-06-2012
08:43 PM
|
0
|
3
|
765
|
POST
|
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"); var landBaseLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://10.1.0.24/ArcGIS/rest/services/test/MapServer", { id: 'India' }); When i try to print the map using Print widgets samples provide under ArcGIS Server 10.1 i am able to get pdf or image but it is showing basemap layer i am unable to get my local Server Service on the Print Map ................Both Can some one suggest me whats the problem with it......... i am using proxy.jsp and provided both the service URL's in the proxy file......... I have tried that with all the samples provided ....Is that any problem with my proxy file or my Service
... View more
08-04-2012
03:23 AM
|
0
|
6
|
1298
|
POST
|
var fireLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/MapServer",{id:'fire'}); var landBaseLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://10.1.0.24/ArcGIS/rest/services/test/MapServer", { id: 'India' }); When i add the above services to map and get Legend or TOC.....i am able to get icons before Layer Name for the fireLayer but it is showing blank for my Local Service Layers .... I am using proxy.jsp and i provided both service urls in proxy ... Is that a problem with proxy file or my Local Service...Is there anything more to add in proxy file.... [ATTACH=CONFIG]16665[/ATTACH]
... View more
08-04-2012
03:14 AM
|
0
|
2
|
637
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|