POST
|
Can you give me any example code or demo app for reference. I want exactly the same way how Identify tool is working in this video. v1 - ArcGIS Javascript API, Identify, Hyperlink manager, Spatial Queries - YouTube Thanks.
... View more
09-29-2015
09:22 AM
|
0
|
0
|
752
|
POST
|
Thanks Robert fro your reply but actually I want to use InfoWindow instead of popup. So do you have any idea how to do that ?
... View more
09-29-2015
07:52 AM
|
0
|
4
|
752
|
POST
|
I am trying to popup an InfoWindow when user click on visible layer after selecting Identify Tool from the menu as shown in the attached image. I followed this example URL(Display identify results in popup | ArcGIS API for JavaScript ) from ESRI officail website and coded so far as below but not succeeded yet. It is showing "map.infoWindow.setFeatures" is not a function" error. Please help me to solve this problem. Please find the code in the attachment. <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--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>Identify with Popup</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.14/esri/css/esri.css">
<style>
html, body, #map {height:100%;width:100%;margin:0;padding:0;}
</style>
<script src="http://js.arcgis.com/3.14/"></script>
<script>
var map;
var identifyListener;
require([
"esri/map",
"esri/layers/FeatureLayer",
"esri/dijit/InfoWindow",
"esri/InfoTemplate",
"esri/layers/ArcGISDynamicMapServiceLayer",
"esri/symbols/SimpleFillSymbol",
"esri/symbols/SimpleLineSymbol",
"esri/tasks/IdentifyTask",
"esri/tasks/IdentifyParameters",
"dojox/layout/FloatingPane",
"esri/dijit/Popup",
"dojo/_base/array",
"esri/Color",
"dojo/dom-construct",
"dojo/dom",
"dojo/on",
"dojo/domReady!"
], function (
Map, FeatureLayer, InfoWindow, InfoTemplate, ArcGISDynamicMapServiceLayer, SimpleFillSymbol,
SimpleLineSymbol, IdentifyTask, IdentifyParameters, FloatingPane, Popup,
arrayUtils, Color, domConstruct, dom, on
) {
var identifyTask, identifyParams;
var infoWindow = new InfoWindow({}, domConstruct.create("div"));
infoWindow.startup();
var popup = new Popup({
fillSymbol: new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID,
new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
new Color([255, 0, 0]), 2), new Color([255, 255, 0, 0.25]))
}, domConstruct.create("div"));
map = new Map("map", {
basemap: "satellite",
center: [84.0000, 20.1500],
zoom: 7,
infoWindow: infoWindow
});
map.on("load", mapReady);
var stateLayerURL = "http://10.172.10.152/odisha/rest/services/GisMain/FYEARPERMITS/MapServer/";
map.addLayer(new ArcGISDynamicMapServiceLayer(stateLayerURL,
{ opacity: 0.55 }));
function mapReady () {
//map.on("click", executeIdentifyTask);
on(dom.byId("identifyMe"), "click", function(evt){
identifyListener = dojo.connect(map, "onClick", executeIdentifyTask);
});
//create identify tasks and setup parameters
identifyTask = new IdentifyTask(stateLayerURL);
identifyParams = new IdentifyParameters();
identifyParams.tolerance = 3;
identifyParams.returnGeometry = true;
identifyParams.layerIds = [6];
identifyParams.layerOption = IdentifyParameters.LAYER_OPTION_TOP;
identifyParams.width = map.width;
identifyParams.height = map.height;
}
function executeIdentifyTask (event) {
identifyParams.geometry = event.mapPoint;
identifyParams.mapExtent = map.extent;
var deferred = identifyTask
.execute(identifyParams)
.addCallback(function (response) {
// response is an array of identify result objects
// Let's return an array of features.
return arrayUtils.map(response, function (result) {
var feature = result.feature;
var layerName = result.layerName;
feature.attributes.layerName = layerName;
var taxParcelTemplate = new InfoTemplate("${S_NAME}", "Tractors : ${TRACTORS_2012}");
feature.setInfoTemplate(taxParcelTemplate);
return feature;
});
});
map.infoWindow.setFeatures([deferred]);
map.infoWindow.show(event.mapPoint);
}
});
</script>
</head>
<body>
<button id="identifyMe">Identify</button>
<div id="map">
</div>
</body>
</html>
... View more
09-29-2015
05:38 AM
|
0
|
6
|
2580
|
POST
|
Thanks Jake. Is there any way to display the country name and add a popup window on click event to display other details about the country ?
... View more
07-20-2015
12:13 PM
|
0
|
0
|
413
|
POST
|
I used the same code by you did not change any thing.
... View more
07-20-2015
05:40 AM
|
0
|
1
|
413
|
POST
|
Thanks for the code. But I am facing a problem when state is selected then Country list is populated, again when another state is selected then country name are populated with the previous values. How to clear the dropDown before populating the values. Thanks.
... View more
07-20-2015
03:49 AM
|
0
|
5
|
413
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|