|
POST
|
Daniel, I would just add this specific layer as a feature layer. Which makes it available for click events and such. FeatureLayer | API Reference | ArcGIS API for JavaScript Tim
... View more
05-14-2015
05:38 AM
|
0
|
1
|
3267
|
|
POST
|
Did you publish those to ArcGIS Online? Or are they from somebody else outside of your organization?
... View more
05-13-2015
11:12 AM
|
0
|
1
|
3424
|
|
POST
|
Filip, did you try looking into this? http://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109 Tim
... View more
05-13-2015
10:37 AM
|
1
|
1
|
1341
|
|
POST
|
Raimonds, make sure that you enable in your browser that your application is allowed to get your location. The locate button worked for me (it didnt locate me but I assume this is because you limit the view). Tim
... View more
05-13-2015
06:12 AM
|
0
|
1
|
1350
|
|
POST
|
Hey Bryan, Maybe we can tackle the problem but first looking at what you are trying to achieve. So you want parcel lines -> below a transparent tiled layer -> below a marker layer. What is the reason for having it in this order? Maybe we can move away from having them in a specific order? Tim
... View more
05-13-2015
05:22 AM
|
0
|
5
|
3424
|
|
POST
|
David, I assume when you mean adding a whole map, you mean publishing it via ArcServer and then yo uadd it to a map in ArcGIS Online? Tim
... View more
05-13-2015
05:06 AM
|
0
|
1
|
1799
|
|
POST
|
Ryan, I am surprised that the field names change so frequently, that doesn't look like a good business procedure. Is there a way you could use ["*"] as your outfield? Tim
... View more
05-12-2015
12:30 PM
|
1
|
0
|
1212
|
|
POST
|
Did you try and expand the layer? Click on the layer name in your table of content and see if it expands.
... View more
05-12-2015
09:30 AM
|
0
|
3
|
1799
|
|
POST
|
Here is an updated fiddle that will also work with just clicking the map: Edit fiddle - JSFiddle I don't know how to show all layers in one window, this would include a lot of customized code.
... View more
05-12-2015
08:23 AM
|
2
|
1
|
5431
|
|
POST
|
Michael it might have something to do with the layer. Check this fiddle: Edit fiddle - JSFiddle Type in an address and it will work.
... View more
05-12-2015
07:36 AM
|
2
|
3
|
3767
|
|
POST
|
Is there a way you can share your code or a link to a fiddle?
... View more
05-11-2015
12:17 PM
|
0
|
5
|
3768
|
|
POST
|
Michael, look at the following code: I have added lines 73 to 81. Line 81 will call the function starting line 106. At this moment it will not select anything from the layers in the example because the geocoded point doesnt fall within a polygon. But assuming it would, it would open the popup and show information about each layer it intersects with. Just to be able to see it use the following address: 920 Sandhurst Rd Bloomfield Hills <!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.13/esri/css/esri.css">
<style>
html, body, #map {
height:100%;
width:100%;
margin:0;
padding:0;
}
#search {
display: block;
position: absolute;
z-index: 2;
top: 20px;
left: 75px;
}
</style>
<script src="http://js.arcgis.com/3.13/"></script>
<script>
var map;
require([
"esri/map",
"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",
"esri/dijit/Geocoder",
"dojo/domReady!"
], function (
Map, InfoTemplate, ArcGISDynamicMapServiceLayer, SimpleFillSymbol,
SimpleLineSymbol, IdentifyTask, IdentifyParameters, Popup,
arrayUtils, Color, domConstruct,Geocoder
) {
var identifyTask, identifyParams, NeededPoint;
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("load", mapReady);
geocoder = new Geocoder({
map: map,
autoComplete: true
},"search");
geocoder.startup();
geocoder.on("select", executeIdentifyTask);
var parcelsURL = "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/BloomfieldHillsMichigan/Parcels/MapServer";
map.addLayer(new ArcGISDynamicMapServiceLayer(parcelsURL,
{ opacity: 0.55 }));
function mapReady () {
map.on("click", executeIdentifyTaskClick );
//create identify tasks and setup parameters
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;
}
function executeIdentifyTask (event) {
identifyParams.geometry = event.result.feature.geometry;
identifyParams.mapExtent = event.result.feature.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(event.result.feature.geometry);
}
function executeIdentifyTaskClick (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;
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(event.mapPoint);
}
});
</script>
</head>
<body>
<div id="search"></div>
<div id="map"></div>
</body>
</html> I hope this helps somewhat. Let me know if you have any question! Tim
... View more
05-11-2015
10:29 AM
|
2
|
9
|
3768
|
|
POST
|
Can you show us your code? It is hard to trouble shoot without seeing any code.
... View more
05-11-2015
08:01 AM
|
1
|
2
|
1520
|
|
POST
|
Also go to USAjob.gov sometimes they advertise jobs that are strictly for recent graduates. They way I got my job was by doing volunteer GIS work for the county I was living in. This will not only give you contacts but it will also introduce you to real life GIS work. Tim
... View more
05-11-2015
05:16 AM
|
0
|
0
|
2718
|
|
POST
|
Look at this example: ArcGIS API for JavaScript Sandbox Instead of using the map click event.point you just need to create your own "event point" that you can get from the find-results event. I hope this explains it a little bit better.
... View more
05-08-2015
12:23 PM
|
3
|
11
|
3768
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-06-2015 06:58 AM | |
| 1 | 05-04-2016 07:27 AM | |
| 1 | 07-06-2017 08:12 AM | |
| 1 | 10-26-2015 11:51 AM | |
| 1 | 12-12-2014 12:05 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|