|
POST
|
I revised Line 32 as: esri.arcgis.gmaps.Config.proxyUrl = "http://localhost:8080/proxy.jsp"; I still got the same result as my last post. However, the InfoWondow does not display.
... View more
07-21-2011
06:37 AM
|
0
|
0
|
822
|
|
POST
|
swingley: The Attribute Inspector appears to be wonderful. I would like to have 2 general Q's: 1) It should be also applicable for JS Extension for Google Maps API's application. If the layer is an esri.layers.FeatureLayer, this method used in the tool should be able to apply for. True or false? 2) If I add a .gpx file (converted from a shapefile, gpx is actually an xml file) on the map, can this be layer be defined as an esri.layers.FeatureLayer? Thanks for your attention. Yours, Shaning
... View more
07-20-2011
07:20 AM
|
0
|
0
|
902
|
|
POST
|
I loaded ESRI's script gp_profile from http://help.arcgis.com/en/webapi/javascript/gmaps/samples/geoprocessor/gp_profile.html and then run it in my server with minor revision. When running the program in my server, the routing path displays on the map correctly, but the Infobox for the Terrain File does not show up as ESRI's sample. I run FireBug and to try to detect the error message. The red message shows that Post http://sampleserver2.arcgisonline.com/ArcGIS/rest/services/Elevation/ESRI_Elevation_World/GPServer/ProfileService/execute&Display.... 500 Internal Server error Below there is the error message: uncaught exception: [Exception... "'Error: Error: Invalid JSON' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "JS frame :: chrome://firebug/content/spy.js :: callPageHandler :: line 744" data: no] Does anyone know how to fix it? Thanks.
... View more
07-20-2011
06:48 AM
|
0
|
0
|
983
|
|
POST
|
Thanks. I did not realize a "," should be placed after State.
... View more
07-19-2011
09:09 AM
|
0
|
0
|
875
|
|
POST
|
I did several more tests. It appears to be that ESRI's geocoding service fails to work as the geocoding status displays on the top-right corner forever. For example, I used the two valid addresses below: 3730 Allendale Circle, Pittsburgh, PA 15204 3600 Forbes Ave., Pittsburgh, PA 15261 I wish ESRI can take care of this.
... View more
07-19-2011
06:06 AM
|
0
|
0
|
875
|
|
POST
|
This is the continuation of my last post with the addition of the 2 images that show the Results.
... View more
07-19-2011
05:34 AM
|
0
|
0
|
1613
|
|
POST
|
Kelly: Thanks for your 2 responses. I installed and run FireBug. I run this script again. Sometimes, I can get the results display on the right panel, sometimes display only the Web Mercator's result, but in most of the time (> 80%), no results display. I viewed the code (Line 69-109), I guess it could be server- or serivice-related. The catched images are in next post. Shaning
... View more
07-19-2011
05:13 AM
|
0
|
0
|
1613
|
|
POST
|
Kelly: Thanks for your response. I followed the procedure/approach you recommended, a) Download proxypage_java.zip. b) Unzip it and then save the file into \Myserver\default\deploy\ROOT.war\ folder c) Open the configuration proxy page (proxy.jsp) in notepad d) Add "http://pccs000103ws:8080/CLM_GIS/", as the needed for the "<url>,<token>" . e) Save the JSP. f) Copy and paste the JS_Draw_and_Measure.htm into the server's folder. In this folder, there is another proxy.asp, the string in d) is also added. g) Use IE to open the page: http://pccs000103ws:8080/CLM_GIS/JS_Draw_and_Measure.htm. The page displays and draw correctly. However, the results are still not returned. In my application, I can open the htm through http://pccs000103ws:8080/CLM_GIS/JS_Draw_and_Measure.htm. Since this htm is in the same folder as the proxy.asp (see described in f)), I referred to http://geochalkboard.wordpress.com/2010/12/13/using-a-proxy-page-with-the-arcgis-server-api-for-javascript/, and tried to access to the proxy.asp thought browser (e.g. http://pccs000103ws:8080/CLM_GIS/proxy.jsp), but the page dies not display. I guess that the address for proxy file is incorrect. How to fix it? Thanks. Shaning
... View more
07-18-2011
12:09 PM
|
0
|
0
|
1613
|
|
POST
|
From http://help.arcgis.com/en/webapi/javascript/arcgis/demos/util/util_measureline.html, I loaded the JavaScript, which provides the function to draw a polyline and receives the line's lengh. I followed the approach in Google Maps Layer for ArcGIS JavaScript API: Examples (http://gmaps-utility-gis.googlecode.com/svn/tags/gmapslayer/1.0/docs/examples.html) to try to add a google map layer on the top of ESRI's map. But I can't see the google map. The code is presented below. If you want to try, please copy, paste it onto Notepad, and then save it as htm file. Then, you can open it locally. Hopefully, you can hint me something. Thanks. I also tried in several other samples *see my other post threads). The common thing is that once I get ESRI's maps, I can't add google map layer on the top. I tried another way, add ESRI maps on top of Google Maps. It works for an ESRI dynamic layer but not for an ESRI cached tiled layer. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" /> <!--The viewport meta tag is used to improve the presentation and behavior of the samples on iOS devices--> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/> <title>Measure Distances</title> <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.4/js/dojo/dijit/themes/claro/claro.css"> <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.4" ></script> <script type="text/javascript" src="http://gmaps-utility-gis.googlecode.com/svn/tags/gmapslayer/1.0/src/gmapslayer_compiled.js" ></script> <script type="text/javascript"> dojo.require("esri.map"); dojo.require("esri.tasks.geometry"); dojo.require("esri.toolbars.draw"); dojo.require("dojo.number"); var geometryService; var gmap; function init() { //identify proxy page to use if the toJson payload to the geometry service is greater than 2000 characters. //If this null or not available the project and lengths operation will not work. Otherwise it will do a http post to the proxy. esriConfig.defaults.io.proxyUrl = "/arcgisserver/apis/javascript/proxy/proxy.ashx"; esriConfig.defaults.io.alwaysUseProxy = false; var startExtent = new esri.geometry.Extent(-80.0571,41.3697,-74.4321,44.0822, new esri.SpatialReference({wkid:4326}) ); var map = new esri.Map("map", {extent:startExtent}); dojo.connect(map, "onLoad", initFunctionality); map.addLayer(new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer")); geometryService = new esri.tasks.GeometryService("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"); dojo.connect(geometryService, "onLengthsComplete", outputDistance); gMap = new gmaps.GoogleMapsLayer({ visible: false, id: 'googlemaps' }); map.addLayer(gMap); } function initFunctionality(map) { var tb = new esri.toolbars.Draw(map); var lengthParams = new esri.tasks.LengthsParameters(); //on draw end add graphic, project it, and get new length dojo.connect(tb, "onDrawEnd", function(geometry) { map.graphics.clear(); lengthParams.polylines = [geometry]; lengthParams.lengthUnit = esri.tasks.GeometryService.UNIT_METER; lengthParams.geodesic = true; geometryService.lengths(lengthParams); var graphic = map.graphics.add(new esri.Graphic(geometry, new esri.symbol.SimpleLineSymbol())); }); tb.activate(esri.toolbars.Draw.FREEHAND_POLYLINE); } function outputDistance(result) { dojo.byId("distance").innerHTML = dojo.number.format(result.lengths[0] / 1000) + " kilometers"; } dojo.addOnLoad(init); </script> </head> <body> Click and hold down on the map to draw a line that will be added to the map. The application will then use the geometry service to project and compute the length of the line. <div id="map" class="claro" style="width:1024px; height:512px; border:1px solid #000;"></div> Distance: <span id="distance"></span> </body> </html>
... View more
07-18-2011
09:36 AM
|
0
|
0
|
3183
|
|
POST
|
The script, provided by ESRI at http://www.arcgis.com/home/item.html?id=72a44473515a4c3da8289c66a1769aba, is a wonderful one. I loaded the script and tried to run at my local unit. The drawing looks fine. However, unlike the demo there that the results display on the right panel, no result displays in my operation. I checked the function getAreaAndLength(geometry) { }. I suspected that it could be caused by the variables wmresults, utmresults and spresults, which are defined specifically. I wish the author can explain this Q, and provide the proper answer. Thanks.
... View more
07-18-2011
07:17 AM
|
0
|
6
|
2057
|
|
POST
|
I revised ESRI's cript in order to add both ESRI dynamic and tiled maps over Google's Maps. It works for add the dynamic one but not the tiled one. I run it locally. The code is below. You can copy, paste and then save it as a htm file, and then run it locally. If you can try and find out the problem, I will appreciate. <!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>Add DynamicMapServiceLayer to GMap</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <script src="http://maps.google.com/maps?file=api&" type="text/javascript"></script> <script src="http://serverapi.arcgisonline.com/jsapi/gmaps/?v=1.6" type="text/javascript" ></script> <script type="text/javascript"> var flag = 0; var gmap = null; var dynamicMap = null; //var gmapOptions; // For ESRI Tiled Map var mapExtension; var gOverlays = null; function initialize() { //gmapOptions = { // mapTypes: [G_PHYSICAL_MAP,G_NORMAL_MAP,G_HYBRID_MAP] //} //Load Google Maps //gmap = new GMap2(document.getElementById("map"),gmapOptions); gmap = new GMap2(document.getElementById("gmap")); var centerat = new GLatLng(0, 0); gmap.addControl(new GLargeMapControl()); gmap.addControl(new GMapTypeControl()); gmap.setCenter(centerat, 2); gmap.enableScrollWheelZoom(); //create mapextension class to be used to add/remove results from the map. mapExtension = new esri.arcgis.gmaps.MapExtension(gmap); var mapOptions = null; var gOverlays = null; } function addDynamicMap() { //create custom dynamic layer //esri.arcgis.gmaps.DynamicMapServiceLayer(url,esri.arcgis.gmaps.ImageParameters?,opacity?,callback?); dynamicMap = new esri.arcgis.gmaps.DynamicMapServiceLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_World/MapServer", null, 0.75, null); if (flag == 0) { GEvent.addListener(dynamicMap, "load", function(groundov) { gmap.addOverlay(groundov); }); flag = 1; } else { } //document.getElementById(???addButton???).disabled=true; } function addTiledMap() { //create mapOptions to specify opacity, minResolution, maxResolution when adding to the map. mapOptions = {opacity: 0.75, minResolution:0, maxResolution: 19}; if (flag == 0) { //create custom tile layer tiledmap = new esri.arcgis.gmaps.TiledMapServiceLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Portland/ESRI_LandBase_WebMercator/MapServer", mapOptions, addTiledMap); flag = 1; } else { } //document.getElementById(???addButton???).disabled=true; } function addTiledMap(gTileLayer) { //Add tile layer as a GTileLayerOverlay using mapExtension gOverlays = mapExtension.addToMap(gTileLayer); } function showMap() { dynamicMap.show(); if (flag == 2) { dynamicMap.show(); // esriTiledMap_Street.show(); flag = 1; } } function hideMap() { if (flag == 1) { dynamicMap.hide(); //esriTiledMap_Street.hide(); flag = 2; } } function removeMap() { gmap.removeOverlay(dynamicMap); // gmap.removeoverlay(esriTiledMap_Street); flag = 0; } </script> </head> <form> <b>ESRI Maps: </b> <input type="button" id="äddButton"value="Add Dynamic Map" onclick="addDynamicMap();" /> <input type="button" id="äddButton"value="Add Tiled Map" onclick="addDTiledMap();" /> <input type="button" value="Hide" onclick="hideMap();" /> <input type="button" value="Show" onclick="showMap();" /> <input type="button" value="Remove" onclick="removeMap();" /> </form> <body onload="initialize();" onunload="GUnload();"> <div id="gmap" style="width: 100%; height: 800px; float:left; "></div> </body> </html>
... View more
07-18-2011
06:42 AM
|
0
|
1
|
1257
|
|
POST
|
stevel: How can I identify whether a script needs the Premier License to run? Thanks. Shaning
... View more
07-18-2011
05:10 AM
|
0
|
0
|
1127
|
|
POST
|
The ArcGIS Extension for the Google Maps API (http://help.arcgis.com/en/webapi/javascript/gmaps/index.html) provides some wonderful literature how to build-up the mashup scripts. However, some of the samples provided in that website do not work properly if its script is deployed locally. Some professional point out that it may be due to the need for the Google Maps API Premier License (http://www.google.com/enterprise/earthmaps/maps.html). How can a programmer know which script needs such a license or not? The article at http://code.google.com/apis/maps/documentation/premier/guide.html#WhyPremier briefly introduces the Google Maps API Premier License. However, I still wonder how to use the Premier License in the deployment. If anyone knows, please share. Thanks.
... View more
07-18-2011
05:08 AM
|
0
|
1
|
999
|
|
POST
|
In ArcGIS Extension for Google Maps API, the sample code: Get Driving Directions (http://help.arcgis.com/en/webapi/javascript/gmaps/samples/routetask/routetask_directions.html) appears to have some bugs. If you runs the script w/o any change, the results look to be fine. If change the starting address: e.g. I put 2325 Birch Log Way, Hacienda Heights, CA 91745, the results obtained: 1) Only the Start point address displays on the map, and the destination address point does not show. 2) Geocoding actually fails. I also run several other tests. Sometime it works but sometimes not. I guess it is due to the failure of geocoding. It appears to be that many addresses can not be geocoded.
... View more
07-16-2011
11:30 AM
|
0
|
3
|
1125
|
|
POST
|
I have the same goal as digy79. Looking at ESRI's sample code, it is possible. However, when I loaded the code and run it loacally, I got problem. In my test, the associated js file was called correctly. Hopefully ESRI can provide a good answer for it.
... View more
07-16-2011
10:09 AM
|
0
|
0
|
1276
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-18-2023 10:02 AM | |
| 3 | 07-14-2023 12:29 PM | |
| 1 | 04-02-2021 12:16 PM | |
| 1 | 07-24-2017 11:31 AM | |
| 1 | 04-04-2016 03:59 AM |
| Online Status |
Offline
|
| Date Last Visited |
04-01-2025
11:58 AM
|