POST
|
This actually should have been the code that is not working: <!DOCTYPE html> <html> <head> <title></title> <!-- Define the versions of IE that will be used to render the page. See Microsoft documentation for details. Optional. --> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta charset="utf-8"> <!-- Responsive --> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="default"> <!-- End Responsive --> <!-- Use protocol relative urls that way if the browser is viewing the page via HTTPS the js/css file will be requested using the HTTPS protocol --> <link rel="stylesheet" href="https://community.esri.com//js.arcgis.com/3.10/js/esri/css/calcite/calcite.css"> <link rel="stylesheet" href="https://community.esri.com//js.arcgis.com/3.10/js/esri/css/esri.css"> <!-- Load any application specific styles --> <link rel="stylesheet" href="css/styles.css"> <!--[if IE 8]> <link rel="stylesheet" href="css/ie.css"> <![endif]--> </head> <body class="calcite app-loading no-touch"> <!-- Loading Indicator --> <div class="loading-indicator"> <div class="loading-message" id="loading_message"></div> </div> <!-- Map --> <!-- The ArcGIS API for JavaScript provides bidirectional support. When viewing the application in an right to left (rtl) language like Hebrew and Arabic the map needs to remain in left-to-right (ltr) mode. Specify this by setting the dir attribute on the div to ltr. --> <div id="mapDiv" dir="ltr"></div> <!-- Panel Content --> <div id="panelContent"> <div id="panelPages"></div> </div> <!-- Panel Top --> <div id="panelTop" class="bg rounded shadow"> <!-- Panel Title --> <div id="panelTitle"> <div class="fc" id="panelText"> </div> <div id="panelSearch"> <div id="panelGeocoder"></div> </div> <div id="panelMenu" class="icon-menu icon-color"></div> </div> <!-- Panel Tools --> <div id="panelTools"> <!--Tools are created programatically--> </div> </div> <script type="text/javascript"> var package_path = window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/')); var dojoConfig = { // The locationPath logic below may look confusing but all its doing is // enabling us to load the api from a CDN and load local modules from the correct location. packages : [{ name : "application", location : package_path + '/js' }, { name : "config", location : package_path + '/config' }] }; </script> <script type="text/javascript" src="//js.arcgis.com/3.10/"></script> <script type="text/javascript"> require(["application/template", "application/main"], function(Template, Main) { // create the template. This will take care of all the logic required for template applications var myTemplate = new Template(); var myApp = new Main(); myTemplate.startup().then(function(config) { myApp.startup(config); }, function(error) { // something went wrong. Let's report it. myApp.reportError(error); }); }); </script> <script> var map; var geocoder; var locatorUrl = "http://maps.decaturil.gov/arcgis/rest/services/Public/WebAddressLocator/GeocodeServer"; require([ "esri/map", "esri/dijit/Geocoder", "dojo/domReady!" ], function( Map, Geocoder ) { map = new Map("mapDiv",{ basemap: "topo", center: [-117.19,34.05], // lon, lat zoom: 13 }); var myGeocoders = [{ url: locatorUrl, name: "LocateValveByAssetID" }]; geocoder = new Geocoder({ map: map, autoComplete: true, arcgisGeocoder: false, geocoders: myGeocoders, value: "146317" },"search"); geocoder.startup(); }); </script> </body> </html>
... View more
08-12-2014
09:41 AM
|
0
|
6
|
741
|
POST
|
Here is the code that we have with our address locator. What do we need to do to get it to work? <!DOCTYPE html> <html> <head> <title></title> <!-- Define the versions of IE that will be used to render the page. See Microsoft documentation for details. Optional. --> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta charset="utf-8"> <!-- Responsive --> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="default"> <!-- End Responsive --> <!-- Use protocol relative urls that way if the browser is viewing the page via HTTPS the js/css file will be requested using the HTTPS protocol --> <link rel="stylesheet" href="https://community.esri.com//js.arcgis.com/3.10/js/esri/css/calcite/calcite.css"> <link rel="stylesheet" href="https://community.esri.com//js.arcgis.com/3.10/js/esri/css/esri.css"> <!-- Load any application specific styles --> <link rel="stylesheet" href="css/styles.css"> <!--[if IE 8]> <link rel="stylesheet" href="css/ie.css"> <![endif]--> </head> <body class="calcite app-loading no-touch"> <!-- Loading Indicator --> <div class="loading-indicator"> <div class="loading-message" id="loading_message"></div> </div> <!-- Map --> <!-- The ArcGIS API for JavaScript provides bidirectional support. When viewing the application in an right to left (rtl) language like Hebrew and Arabic the map needs to remain in left-to-right (ltr) mode. Specify this by setting the dir attribute on the div to ltr. --> <div id="mapDiv" dir="ltr"></div> <!-- Panel Content --> <div id="panelContent"> <div id="panelPages"></div> </div> <!-- Panel Top --> <div id="panelTop" class="bg rounded shadow"> <!-- Panel Title --> <div id="panelTitle"> <div class="fc" id="panelText"> </div> <div id="panelSearch"> <div id="panelGeocoder"></div> </div> <div id="panelMenu" class="icon-menu icon-color"></div> </div> <!-- Panel Tools --> <div id="panelTools"> <!--Tools are created programatically--> </div> </div> <script type="text/javascript"> var package_path = window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/')); var dojoConfig = { // The locationPath logic below may look confusing but all its doing is // enabling us to load the api from a CDN and load local modules from the correct location. packages : [{ name : "application", location : package_path + '/js' }, { name : "config", location : package_path + '/config' }] }; </script> <script type="text/javascript" src="//js.arcgis.com/3.10/"></script> <script type="text/javascript"> require(["application/template", "application/main"], function(Template, Main) { // create the template. This will take care of all the logic required for template applications var myTemplate = new Template(); var myApp = new Main(); myTemplate.startup().then(function(config) { myApp.startup(config); }, function(error) { // something went wrong. Let's report it. myApp.reportError(error); }); }); </script> <script type="text/javascript"> var map; var locatorUrl = "http://maps.decaturil.gov/arcgis/rest/services/Public/WebAddressLocator/GeocodeServer"; var myGeocoders = [{ url: locatorUrl, singleLineFieldName: "SingleLine", name: "Enter Address" }]; geocoder = new Geocoder({ map: map, autoComplete: true, arcgisGeocoder: false, geocoders: myGeocoders },"search"); geocoder.startup(); </script> </body> </html>
... View more
08-12-2014
07:30 AM
|
0
|
13
|
3839
|
POST
|
This worked perfect. Thanks Rene. You'll want to listen to the 'onLayerAdd' event when adding individual layers. http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi/map.htm#onLayerAdd So something like dojo.connect(map, 'onLayerAdd', function(){
alert(basemap.layerInfos[0].name);
});
map.addLayer(basemap); Right now you're trying to access the layerInfos immediately after adding it to the map, but you have to wait for it to finish loading before you can interact with it. You might even be able to listen to the individual layers onLoad, but I haven't tried that way. http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi/layer.htm#onLoad
... View more
12-12-2012
12:54 PM
|
0
|
0
|
776
|
POST
|
Attached is modification of your page. I placed the JavaScript below the body tag and before the html tag based on best practices, but you should be able to run this page with no problem. Let me know if you have any questions. Chris S.
... View more
12-12-2012
06:10 AM
|
0
|
0
|
336
|
POST
|
I am attempting to display the name of a layer in an alert box. I have attached the .NET project. Here is the JavaScript code that I am using with a comment above the line where I am attempting to get the name of the layer. Any ideas what I need to do? : <script type="text/javascript"> dojo.require("esri.map"); dojo.require("esri.layers.agstiled"); // cached map service. var map; function init() { map = new esri.Map("mapDiv"); dojo.connect(window, 'resize', map, map.resize); var baseMapURL = "http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"; var basemap = new esri.layers.ArcGISTiledMapServiceLayer(baseMapURL); map.addLayer(basemap); // I want this alert to display the layer name which should be Topographic Info. alert(basemap.layerInfos[0].name); } dojo.addOnLoad(init); </script> Thanks. Chris S.
... View more
12-12-2012
05:18 AM
|
0
|
2
|
1455
|
POST
|
I ended up removing this block of code: ptGraphic.setInfoTemplate(new esri.InfoTemplate("Coordinates", "<p> X: " + point.x + "<br/> Y: " + point.y + "</p>" + "<input type='button' value='Convert back to LatLong' onclick='projectToLatLong();' />" + "<div id='latlong'></div>")); map.infoWindow .setTitle(ptGraphic.getTitle()) .setContent(ptGraphic.getContent()) .show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint)); apparently, the infoWindows conflicted with one another. I just set the x and y coordinates to fields on the web page.
... View more
05-23-2012
01:41 PM
|
0
|
0
|
492
|
POST
|
Area you able to verify via console.log or Chrome debug tools that the identifyParams are still correct after you run the project point? I would console.log the whole path of execution to find out where something is not firing. I glanced over the code, but nothing glaring seems to stick out. How would I do that -->> I would console.log the whole path of execution
... View more
05-23-2012
01:00 PM
|
0
|
0
|
492
|
POST
|
well your project deactivates the identifyhandle, do you ever reactivate it? The runIdentify() function reactivates it when the user clicks the Identify button. It works fine with the measure line button.
... View more
05-23-2012
12:59 PM
|
0
|
0
|
492
|
POST
|
I have an identify button and a project point button. If I click on Identify and then click on the map, Identify works fine, but if I click on the project point button, the project point works, but my Identify stops working. I have included a video to explain: http://youtu.be/RRhQwS8sxaM I have also posted the code on github at: https://github.com/csergent45/SOA-Final reactor.js within the js folder is where the bulk of the code that runs this application, but all the code that has to with identify and projecting the point are in this file. Thanks. Chris S.
... View more
05-23-2012
11:48 AM
|
0
|
8
|
907
|
POST
|
How do I make a web service page secure so that only I can see it? Here is a video of what I am asking: http://youtu.be/2kQlxWRkJxc Thanks. Chris
... View more
05-03-2012
05:26 AM
|
0
|
1
|
1970
|
POST
|
I removed that line of code and it works. Thanks. 🙂 Hello, Within your init() function you are setting the onclick event of the map to fire the doIdentify(). I disabled that and the operations seemed to function in the way you wished. However, I did have to click the Identify tool to get it to recognize that it needed to identify items. I haven't looked in to it much further, but thought I would share. This might not work for you if you are wanting to set the identify as the primary task. I will look further tomorrow unless someone else with more experience helps you out first. Best wishes,
... View more
04-17-2012
12:47 PM
|
0
|
0
|
461
|
POST
|
Derek, I uploaded a revised version of the application that includes a connect and disconnect. It still does not disconnect. There is a variable identifyHandle at the top, a dojo.connect when the map loads and then I created another connect for the identify button and a disconnect for the measure button. Any thoughts? Chris Hi Chris, Disconnect your event listener that runs your identify when the measure button is clicked. I haven't dug into your code but somewhere you probably do:
dojo.connect(map, "onClick", executeIdentify);
dojo.connect returns a handle to the event listener you can use to later disconnect the event like so:
var identifyHandle = dojo.connect(map, "onClick", executeIdentify);
// later, when your measure button is clicked:
dojo.disconnect(identifyHandle);
When the measure widget is deactivated, you can re-connect your identify listener.
... View more
04-16-2012
02:02 PM
|
0
|
0
|
461
|
POST
|
When running another task I would like to deactivate the identify task. How do I do this? Here is a video of what I am trying to do: http://youtu.be/xO9DW7LrMhc And here is the entire project on DropBox: http://db.tt/kyu59b6a
... View more
04-16-2012
07:50 AM
|
0
|
7
|
1177
|
POST
|
I want to know how to determine if a web service is running/exists. The following video provides the details: http://youtu.be/C1_wEBXx7oI Thanks again. Chris S.
... View more
02-08-2012
11:45 AM
|
0
|
0
|
426
|
POST
|
If you're setting up a query task against a layer that's in a map service you've already added to your JS API map, you can use the map service's layerInfos to loop through and match a name to an id. Otherwise, use esri.request() to make a call to your map service endpoint. The JSON that comes back will have a layers property. Layers is an array of objects where each object corresponds to a layer in the map service. Every layer object will have an id and a name. And thank you for the video- wish more people would do that :). Thanks Derek. This works. Here is a line of code with my alert: alert(dynamicMapServiceLayer.layerInfos[4].name); I have found videos to save time in explaining. 😄
... View more
01-27-2012
12:04 PM
|
0
|
0
|
465
|
Title | Kudos | Posted |
---|---|---|
1 | 06-24-2015 06:06 AM | |
1 | 07-15-2015 12:34 PM | |
1 | 02-26-2015 12:31 PM | |
1 | 05-21-2015 02:27 PM | |
1 | 07-13-2015 09:18 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|