arcgis-js-api

How can I return the value of a deferred method in javascript

◇◆丶佛笑我妖孽 提交于 2020-01-17 05:09:08
问题 I am trying to write a module which projects coordinates into a new Spatial Reference, but the javascript syntax has beaten me once again. This is how the module currently looks like: define(["esri/geometry/Point", ...], function(Point, SpatialReference, ...){ var gmsvc = new GeometryService("http://server/maps/rest/services/Utilities/Geometry/GeometryServer"); /*...*/ return { /*...*/ //transforms the current point on the map to the new wkid transformCoordinates: function(point, newWkId) {

Display attribute value from arcgis layer to html textbox

一笑奈何 提交于 2020-01-07 09:43:35
问题 I want to display attribute value from arcgis layer to html input textbox using javascript Can anyone help me on this issue? Best Regards. 回答1: Just click on a tree, it will fill the inputText on the top right corner <link rel="stylesheet" type="text/css" href="https://js.arcgis.com/3.19/esri/css/esri.css"> <style> html, body, #mapDiv { height: 100%; padding: 0; margin: 0; } #inputAttribute { position: absolute; top: 10px; right: 10px; width: 300px; } </style> <script>var dojoConfig = {

How do I find the center of a number of geographic points?

丶灬走出姿态 提交于 2020-01-01 01:33:26
问题 If I have a series of points as longitude and latitude, how would I calculate the center of all of those points? 回答1: Geomidpoint covers 3 different methods for calculating this. 回答2: Several people have answered to take the mean of the latitudes and longitudes. This is sort of the right idea, but means are more complicated on the sphere. The latitude/longitude representation is essentially artificial and has discontinuities (at the poles, and opposite the prime meridian if you aren't careful

How do I call a function that is defined inside of require() outside of the require()?

孤街醉人 提交于 2019-12-25 18:41:50
问题 I am using ArcGIS API for Javascript 3.21. I have a function inside of the require(). I want the function to be called when a button is clicked, but the button is outside the require(). <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="//js.arcgis.com/3.7/js/esri/css/esri.css"> <style> html, body, #map { height: 100%; width: 100%; margin: 1; padding: 1; } </style> <script src="//js.arcgis.com/3.7/"></script> <script> var map; require([ "esri/map", "esri/geometry/Point", "esri/symbols

ArcGIS API - Execute QueryTask unsupported

拟墨画扇 提交于 2019-12-25 03:52:39
问题 So, I am using the ArcGIS API (javascript) in order to get some information from objects in a featurelayer. The first step here should be detecting which object the user clicked. I am using queries for this. For some reason though, I cannot seem to execute my queries. Every time the execute method is called, the console replies that "Object doesn't support property or method 'execute'". The relevant part of the code is as follows: thema_4_Verblijf = new FeatureLayer("https://services

Is it possible in ArcGIS to draw a polyline or polygon programmatically?

社会主义新天地 提交于 2019-12-24 06:37:21
问题 Is it possible in ArcGIS to draw a polyline or polygon programmatically if I provide the required coordinates for the geometry? Like for a polyline, I would be providing two endpoints for the line. 回答1: This is possible in both 2D/3D. The simplest way is adding a Graphic containing the Polyline (or any other geometry) to the view's graphics: // Coordinates of Zurich, Switzerland var pointA = [8.5107858, 47.3922425]; // Coordinates of Kochi, India var pointB = [76.3333005, 10.0023473]; var

textbox does not active by clicking on radio button

青春壹個敷衍的年華 提交于 2019-12-23 07:02:58
问题 i have created two radio button to get value i.ee max it goes to same varibale total. i wanted to active only one textbox at a time. and accept value. <dt> <dd> <input id="clicking" data-dojo-type="dijit/form/RadioButton" name="method" type="radio" value="clickarea" checked="false"> <label for="clicking">By Clicking</label><br> <input type="text" name="Name" data-dojo-type="dijit/form/TextBox" data-dojo-props="trim:true, propercase:true" value="" id="Area1" disabled = "true" > </dd> </dt> <br

Dojo/request undefined despite require

北战南征 提交于 2019-12-13 08:49:37
问题 In a script associated with an Orchard view I try to post an AJAX to server with dojo.request.post function. However, I only get esri/request , dojo/request is undefined. I call the request outside the function where the require statements reside, but there's no problem with other required packages as long as I use them in correct format. Dojo/request works in our other project, so I suspect Orchard of messing things up (the other project's dojo/request use is in a plain page, not in a view),

How to rotate a MapImage with ArcGIS Javascript API

橙三吉。 提交于 2019-12-13 06:53:32
问题 I created a map and added a MapImage trough a MapImageLayer . Now I want to rotate the image by a certain angle on the map. How is this possible? Or is there an other way to add a rotated image to a map? var map; require(["esri/geometry/Extent", "esri/geometry/geometryEngine", "esri/layers/MapImageLayer", "esri/layers/MapImage", "esri/map", "dojo/domReady!" ], function(Extent, geometryEngine, MapImageLayer, MapImage, Map) { map = new Map("map", { basemap: "topo", center: [-80.93, 31.47], zoom

Getting JavaScript runtime error: irrationalPath, what does it mean?

守給你的承諾、 提交于 2019-12-12 18:43:12
问题 In my MasterPage i'm using the following script <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.3"></script> And in my application, i have this peace of JavaScript code document.getElementById(menu_number).src = "<%=HttpContext.Current.Request.ApplicationPath%>/UI/Common/Images/down-arrow.gif"; I also have the Application_AcquireRequestState method below public void Application_AcquireRequestState(object sender, EventArgs e) { // Get http context from