|
POST
|
Sorry paste the wrong one. Here the one I use: require([ "esri/map", "esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol", "esri/dijit/Popup", "dojo/_base/array", "esri/Color", "myCustomModule/moduleI", "dojo/dom-construct", "dojo/domReady!" ], function ( Map, SimpleFillSymbol, SimpleLineSymbol, Popup, arrayUtils, Color, moduleI, domConstruct ) {
... View more
03-31-2016
10:54 AM
|
0
|
2
|
945
|
|
POST
|
Hello All, I try to create a module from Sample here: Display identify results in popup | ArcGIS API for JavaScript but got error message on "mapPoint" of undefined. Not sure how you send the map click point to module? or Do you have simple sample for creating a mudule using query or identify? Thank you. 1. index.html <!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>Identify with Popup</title>
<link rel="stylesheet" href="https://js.arcgis.com/3.16/esri/css/esri.css">
<style>
html, body, #map {
height:100%;
width:100%;
margin:0;
padding:0;
}
</style>
<script type="text/javascript">
var dojoConfig = {
packages: [{
name: 'myCustomModule',
location: location.pathname.replace(/\/[^/]+$/, '') + '/myCustomModule'
}]
};
</script>
<script src="https://js.arcgis.com/3.16/"></script>
<script>
var map;
require([
"esri/map",
"esri/dijit/Popup",
"dojo/_base/array",
"esri/Color",
"myCustomModule/moduleI",
"dojo/dom-construct",
"dojo/domReady!"
], function (
Map, InfoTemplate, ArcGISDynamicMapServiceLayer, SimpleFillSymbol,
SimpleLineSymbol, IdentifyTask, IdentifyParameters, Popup,
arrayUtils, Color, moduleI, domConstruct
) {
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: [-83.275, 42.573],
zoom: 18,
infoWindow: popup
});
map.on("click", function(){
moduleI.executeIdentifyTask();
})
});
</script>
</head>
<body>
<div id="map"></div>
</body>
</html> 2.moduleI.js define([
"esri/InfoTemplate",
"esri/layers/ArcGISDynamicMapServiceLayer",
"esri/symbols/SimpleFillSymbol",
"esri/symbols/SimpleLineSymbol",
"esri/tasks/IdentifyTask",
"esri/tasks/IdentifyParameters",
"esri/dijit/Popup",
"dojo/_base/array",
"esri/Color",
"dojo/dom-construct",
],function(
InfoTemplate, ArcGISDynamicMapServiceLayer, SimpleFillSymbol,
SimpleLineSymbol, IdentifyTask, IdentifyParameters, Popup,
arrayUtils, Color, domConstruct
){
return{
executeIdentifyTask:function(evt){
var identifyTask, identifyParams;
var parcelsURL = "https://sampleserver3.arcgisonline.com/ArcGIS/rest/services/BloomfieldHillsMichigan/Parcels/MapServer";
map.addLayer(new ArcGISDynamicMapServiceLayer(parcelsURL,
{ opacity: 0.55 }));
identifyTask = new IdentifyTask(parcelsURL);
identifyParams = new IdentifyParameters();
identifyParams.tolerance = 3;
identifyParams.returnGeometry = true;
identifyParams.layerIds = [0, 2];
identifyParams.layerOption = IdentifyParameters.LAYER_OPTION_ALL;
identifyParams.width = map.width;
identifyParams.height = map.height;
identifyParams.geometry = evt.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;
if (layerName === 'Tax Parcels') {
var taxParcelTemplate = new InfoTemplate("",
"${Postal Address} <br/> Owner of record: ${First Owner Name}");
feature.setInfoTemplate(taxParcelTemplate);
}
else if (layerName === 'Building Footprints') {
console.log(feature.attributes.PARCELID);
var buildingFootprintTemplate = new InfoTemplate("",
"Parcel ID: ${PARCELID}");
feature.setInfoTemplate(buildingFootprintTemplate);
}
return feature;
});
});
// InfoWindow expects an array of features from each deferred
// object that you pass. If the response from the task execution
// above is not an array of features, then you need to add a callback
// like the one above to post-process the response and return an
// array of features.
map.infoWindow.setFeatures([deferred]);
map.infoWindow.show(evt.mapPoint);
}
}
}); //define function
... View more
03-31-2016
10:17 AM
|
0
|
4
|
3551
|
|
POST
|
My app have toc that I use from here (http://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109 ). I try to use JavaScript web Optimizer to upload custom module and keep getting error message. I think "Upload Zipped App" is the only method let you create your custom modules. Am I correct? If I use "upload module list" method only create all the lists I use inside require on main app(index.html) & TOC.js but not defined dojoConfig. See my attachment files(file layout, dojoConfig on index.html, error on setting up scanning modules, and package json). Any help will be greatly appreciated. Thank you.
... View more
01-28-2016
06:07 AM
|
0
|
0
|
1825
|
|
POST
|
Can someone give me some ideas how to do this? At least get rid of the error message. Thank you.
... View more
10-15-2015
07:42 AM
|
0
|
0
|
604
|
|
POST
|
I try update the code but still got error message if reselect the same parcel that already showed on the datagrid. Thank you Ken.
... View more
10-09-2015
09:46 AM
|
0
|
1
|
604
|
|
POST
|
Hello all, I found this thread - Add more selection parcels to current datagrid able to select additional parcel(s) to current datagrid but is there possible to click a button to remove current any highlighted parcels on a map? Besides that, I found an error message. If the parcels have been selected and you accidentally reselect it again then you will get an error message. So can you ignore it or prevent the error message so the datagrid table will still got the same results from your early search instead of showing error message on datagrid? Ken also provided code in fiddle: Edit fiddle - JSFiddle Thank you. J
... View more
10-09-2015
08:03 AM
|
0
|
3
|
2682
|
|
POST
|
Here is the example to find street intersection: Edit fiddle - JSFiddle
... View more
09-02-2015
12:04 PM
|
1
|
1
|
1624
|
|
POST
|
Thanks. It works! How about show "Score" on popup infowindow?
... View more
09-02-2015
11:44 AM
|
0
|
0
|
1037
|
|
POST
|
Hello All, I try to use search widget to find street intersection and here are my two jsfiddle files but I am not sure why the first code with define locator is not showing up the correct intersection point. Please try this streets: e state st & n 5th st, redlands ca 1. jsfiddle http://jsfiddle.net/sky12/L8c035rg/1/ 2. jsfiddle - Esri default http://jsfiddle.net/sky12/0pod8chb/ Besides that, can you tell me how to show the "score" information on poup infowindow as well. Thanks.
... View more
09-02-2015
10:51 AM
|
0
|
4
|
3444
|
|
POST
|
Would you mind show me your javascript code? So you basically have to create a map extent to define the boundary? Thank you.
... View more
09-01-2015
11:47 AM
|
0
|
1
|
1624
|
|
POST
|
Jeff, That's is what I need. The user can just type in two street names like your example without specific city then able to zoom to location after you select one of the results. Thank you.
... View more
09-01-2015
09:36 AM
|
0
|
4
|
1624
|
|
POST
|
Does anyone has an example for street intersection? Thanks.
... View more
09-01-2015
05:54 AM
|
0
|
9
|
4070
|
|
POST
|
Thank you so much. It works. Can I ask you last questions before I mark this thread or I need to open a new thread. Not sure. I try to add some functions inside showResults() to can zoom to selected parcels on datagrid record, mouseover to highlight parcel or mouseout. I didn't find any error message when adding those functions. Thanks again. gridP.on("rowclick", onRowClickHandler); gridP.on("mouseover", onMouseOverHandler); gridP.on("mouseout", onMouseOutHandler); function onRowClickHandler(evt) { var clickedTaxLotId = evt.grid.getItem(evt.rowIndex).parcelid; var selectedTaxLot = arrayUtils.filter(parcelGL.graphics, function (graphic) { return ((graphic.attributes) && graphic.attributes.parcelid === clickedTaxLotId); }); if ( selectedTaxLot.length ) { map.setExtent(selectedTaxLot[0].geometry.getExtent(), true); } } function onMouseOverHandler(evt){ if(evt.rowIndex == -1){ return; } var grid = registry.byId("gridP"); var rowId = grid.getItem(evt.rowIndex).parcelid; arrayUtils.some(parcelGL.graphics,function(graphic){ if ((graphic.attributes) && graphic.attributes.parcelid === rowId) { graphic.setSymbol(sfs); return true; } }); } function onMouseOutHandler(evt){ arrayUtils.some(parcelGL.graphics,function(graphic){ if (graphic.symbol == sfs) { graphic.setSymbol(symbolP); return true; } }); };
... View more
05-14-2015
02:05 PM
|
0
|
1
|
2491
|
|
POST
|
I comment out this line //findParams.contains = false; then able to run a text search and everything working great! Is there possible to make buffer ring on top of parcels? Didn't find it under API reference for GraphicsLayer. Thank you Robert so much for your time.
... View more
05-14-2015
06:50 AM
|
0
|
3
|
2491
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-02-2015 12:04 PM | |
| 1 | 04-06-2016 10:14 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:25 AM
|