arcgis-js-api

Single layer visible in LayerList widget (ArcGIS JavaScript)

走远了吗. 提交于 2019-12-12 02:43:42
问题 Is it possible to have a single layer visible on the map in this ESRI tutorial LayerList widget ? Each time you click on a layer, the previous one should deactivate. So you always have only one layer on the map. Michelle 回答1: I managed to write a code for you . Check it and let me know : <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <title>Layer List Dijit<

Dojo.request.post - returned promise says “rejected”, but server seems to have accepted the request

杀马特。学长 韩版系。学妹 提交于 2019-12-11 20:23:23
问题 I try to add a feature to an ArcGIS feature service through Arcgis JavaScript API and dojo/request . I've already been pointed to how to include the request module and I get some response from the server, but after few days of exploring different solutions I didn't manage to execute the callback function. My code: esri.config.defaults.io.corsEnabledServers.push("remotearcgisserver.com"); var uri = "http:/remotearcgisserver.com/arcgis/rest/services/foo/bar/FeatureServer/0/addFeatures" //no

Is it possible to fetch the number of items with a certian property against the propery from a CSVLayer in ArcGIS Javascipt API?

对着背影说爱祢 提交于 2019-12-11 16:56:25
问题 Is it possible to fetch the number of items with a certain property against the property from a CSVLayer in ArcGIS Javascript API? This is the csv file. My intent is to Category 0 - 1 Category 1 - 0 Category 2 - 1 Category 3 - 0 if we are showing Legends from the "Category" property and all the documents are in the view. Also is it possible to filter the items based on the same property? Also is it possible to show the details in a Pie Chart? 回答1: You can use client side queries to retrieve

Customizing leaflet popup in R

橙三吉。 提交于 2019-12-11 07:38:21
问题 I am using RStudio to create a choropleth leaflet map. I have Country and Url as an attribute in the shapefile that I imported to R. I wish to show the Country name and URL as a hyperlink within the popup of the final map. Below is the code I have used so far: m <- world_shapefiles %>% leaflet() %>% addProviderTiles(providers$Esri.WorldStreetMap) %>% addPolygons( label=~country, labelOptions = labelOptions(style = list("font-weight" = "normal", padding = "3px 8px", textsize = "15px",

Esri proxy for Angular 7 project to screenshot

蹲街弑〆低调 提交于 2019-12-11 03:51:18
问题 My team is currently working on a web application with angular 7 front end and .net core 2.1 back-end. One of tasks i need to do is to grab a screenshot and attach it to an email. The web application has an esri-map. For the purposes of capturing the screenshot i am using html2canvas package. It works as expected except for the part that it doesn't capture the esri map content. It captures everything else except the esri-map. For the html2canvas function call, i set the allowTaint property

Error “Cannot use 'new' with an expression whose type lacks a call or construct signature.” when importing Esri types

天大地大妈咪最大 提交于 2019-12-11 00:11:57
问题 I feel like there is something really simple that I am missing here. I've got a class that I am building out that uses Esri ArcGIS API, but when I import the type definitions from the arcgis-js-api 's d.ts file, I get the typescript error "Cannot use 'new' with an expression whose type lacks a call or construct signature." Ex: import * as IMap from 'esri/Map'; export class Foo { bar: (Map: IMap) { const map = new Map(); // <-- error here } } relevant snippets from the d.ts file: declare

custom map does not display

喜夏-厌秋 提交于 2019-12-08 12:03:36
问题 i have published suitability map on arc server. but my map does not display, i have followed arcgis java script api example. i want to display suitability map of the desired area. when user click on the map pop window display the analysis result here is my code <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <title>Create web map from id</title> <link rel=

Uncaught TypeError: Cannot read property 'on' of undefined in arcgis

隐身守侯 提交于 2019-12-08 02:05:34
问题 i am trying to display navigation tool and switch base map.Individually both are working good when i combine it its showing Uncaught Type Error: Cannot read property 'on' of undefined.can any tell me what is the mistake <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/> <title></title> <link rel="stylesheet" href="https://js.arcgis.com/3.15/dijit/themes/claro

ArcGIS JavaScript API 3.9 - mouse-drag events don´t work in Internet Explorer 11

走远了吗. 提交于 2019-12-07 12:18:32
问题 I am facing a problem with mouse-drag event form ArcGIS API for JavaScript 3.9 in Internet Explorer 11 The code is below: map.on("mouse-drag", zobraudalost); function zobraudalost() { alert("test"); } The problem is that, this event doesn´t fire at IE 11 (as well as mouse-drag-start, mouse-drag-end). But on the other browsers it works fine (IE9, Firefox, Chrome). The other problem is that other mouse events (click, mouse-move, etc) work fine on IE 11, so the problem is only with the mouse

How to set Arcgis Javascript dojoConfig relative path of packages

喜夏-厌秋 提交于 2019-12-07 06:55:01
问题 I am using Arcgis Javascript API. API is built on dojo toolkit. So I need to use dojo features in API. I am preparing dojo config file as following. var pathRegex = new RegExp("/\/[^\/]+$/"); var locationPath = location.pathname.replace(pathRegex, ''); var dojoConfig = { async: true, parseOnLoad: false, baseUrl:"js/", packages: [ { name: "application", location: locationPath + '/js/application' }] }; I created a bootstrapper.js like following. require(["application/main", "dojo/domReady!"],