|
POST
|
Do you have a public service we can use to reproduce this?
... View more
05-01-2013
02:56 PM
|
0
|
0
|
2656
|
|
POST
|
Check out the Geoprocessing with result map service sample.
... View more
05-01-2013
02:17 PM
|
0
|
0
|
2551
|
|
POST
|
There's nothing in the API to do this for you�?? you'll have to parse the coordinates and wkid yourself.
... View more
05-01-2013
12:37 PM
|
0
|
0
|
707
|
|
POST
|
This: logMessage("map says layer is loaded. Layer: " + layer + ". Error: " + error + ". Tile Info LODs Length: " + layer.tileInfo.lods.length); Specifically the layer.tileInfo.lods.length part is what's breaking your page. mapAddLayerResult fires each time a layer is added so it's called each time you add a graphics layer. Since graphics layers don't have a tileInfo property, your code is breaking.
... View more
05-01-2013
11:50 AM
|
0
|
0
|
1103
|
|
POST
|
I was told yesterday that they will be up by the end of the week. Sorry for the delay.
... View more
05-01-2013
08:43 AM
|
0
|
0
|
1496
|
|
POST
|
The easiest way I can think of to do this is to set each feature layer's info template to null. Something like this:
dojo.connect(kml, 'onLoad', function(lyr) {
// set up event listeners on each layer that makes up the kml layer
var layers = lyr.getLayers();
dojo.forEach(layers, function(lyr) {
lyr.setInfoTemplate(null);
dojo.connect(lyr, "onClick", function(e) {
// do your on click stuff here
});
});
This works because the map popup (or info window) is driven by whether or not a feature has an info template. if a graphic (or a graphics layer, or a feature layer) doesn't have an info template then no popup will be shown when a graphic (feature) is clicked.
... View more
04-30-2013
04:18 PM
|
0
|
0
|
671
|
|
POST
|
I put together a simple test case:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7, IE=9, IE=10">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title></title>
<link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/js/esri/css/esri.css">
<style>
html, body, #map {
height: 100%; width: 100%; margin: 0; padding: 0;
}
#feedback {
background: #fff;
bottom: 30px;
color: #444;
position: absolute;
font-family: arial;
height: auto;
left: 20px;
margin: 5px;
padding: 10px;
bottom: 20px;
width: 200px;
z-index: 40;
}
</style>
<script src="http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/"></script>
<script>
var map;
require([
"dojo/dom", "dojo/on", "dojo/query",
"esri/map", "esri/layers/FeatureLayer", "esri/tasks/query",
"dojo/domReady!"
], function(dom, on, dojoQuery, Map, FeatureLayer, Query) {
map = new Map("map", {
basemap: "streets",
center: [-93.011, 44.951],
zoom: 11
});
var fl = new FeatureLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/1", {
id: "BlockGroups"
});
map.addLayer(fl);
// generate 10 random numbers < 200,000
var randoms = [];
for ( var i = 0; i < 10; i++ ) {
randoms.push(parseInt(Math.random() * 200000));
}
on(dom.byId("runQuery"), "click", function() {
var queryMethod = dojoQuery("input[name=queryType]:checked")[0].value;
var params = new Query();
params.returnGeometry = false;
if ( queryMethod === "where" ) {
// params.where = "OBJECTID IN (300, 301)";
params.where = "OBJECTID IN (" + randoms.join(",") + ")";
console.log("set params.where", params.where);
} else {
// params.objectIds = [ 300, 301 ];
params.objectIds = randoms
console.log("set params.objectIds", params.objectIds);
}
fl.queryFeatures(params).then(querySuccess, queryError);
});
function querySuccess(results) {
console.log("query success: ", results);
}
function queryError(error) {
console.log("query error: ", error);
}
}
);
</script>
</head>
<body>
<div id="map"></div>
<div id="feedback">
Query using:
<br>
<input type="radio" name="queryType" id="whereClause" value="where" checked="checked"><label for="whereClause">Where</label>
<input type="radio" name="queryType" id="objectIds" value="objectIds"><label for="objectIds">ObjectIds</label>
<br>
<button id="runQuery">Query</button>
</div>
</body>
</html>
That code is querying ten random features by OID from a layer with ~200k features (census block groups). Querying with .where or .objectIds takes the same amount of time. Can you repro your issue with the code above? Is this case similar to what you're doing? I would pursue this on the DB side to see what the different queries look like for query.where vs. query.objectIds.
... View more
04-30-2013
09:08 AM
|
0
|
0
|
3085
|
|
POST
|
Yes, it's used in most of our samples as it is on by default. Take a look at the simple create a map sample: http://developers.arcgis.com/en/javascript/samples/map_simple/ The attribution widget is in the lower-right next to the esri logo.
... View more
04-30-2013
07:42 AM
|
0
|
0
|
1219
|
|
POST
|
Diana's answer will do what you want�?? specifying highlight: false will cause features associated with the popup to not be highlighted. Here's an alternate solution where the address point (rather than the city limits polygon) is passed to the popup: http://jsfiddle.net/95KYJ/ Note line 87 (which I've commented out):
map.infoWindow.highlight = false;
... View more
04-29-2013
03:06 PM
|
0
|
0
|
961
|
|
POST
|
I am with you on the UI aspect. However, it's over 100 layers each with 15+ fields and many may change soon so this is the best approach for now for us. The esri.dijit.PopupTemplate can do this, it does support wildcards for all fields, just like infoTemplate, right? Yes, it can be done but it looks terrible and is hardly readable. This is what you're missing:
var infoTemplate = new esri.dijit.PopupTemplate({
title: feature.attributes.layerName,
description: "{*}"
});
... View more
04-26-2013
07:44 AM
|
0
|
0
|
2772
|
|
POST
|
It will require more code writing and "assumptions" to have to generate the where clause every single time. How is generating a where clause considerably more effort than generating an array of objectIds? Whether it's a where clause (a string) or an array of numbers, you're setting a property on a query object. Building a comma separated string is slightly more effort, but it's minimal. So to recap, this appears to be an ESRI bug. Is it not better for ESRI to address this issue? In the meantime, I will have to "play around" with the code to account for this "feature" ... or there lack of. Hold on there...we can call this a bug when there's a repro case. In the small bit of testing I've done, I don't see dramatic differences in the time for selectFeatures to complete when using query.where vs. query.objectIds. If you'd like to take this further, we need a repro case that clearly shows the problem or you could open a ticket with support and have them help investigate (possibly easier option).
... View more
04-25-2013
03:05 PM
|
0
|
0
|
3085
|
|
POST
|
Since you can see similar performance issues at the REST tier, that indicates that the performance problem is in something ArcGIS Server is doing or, more likely, that there's a performance issue on the database side, which is a whole other world of troubleshooting. I would go with what's fast: use query.where as opposed to query.objectIds. Any reason you can't do that?
... View more
04-25-2013
09:31 AM
|
0
|
0
|
3085
|
|
POST
|
Can you reproduce this using the REST endpoint for your service or is it only slow when querying via a Feature Layer? What I mean by querying using the REST endpoint is to go to the URL for your layer, I'll use this one as an example: http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3 And do your queries there. Query using a where clause: http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3/query?where=OBJECTID+IN+%283%2C+4%29&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=&returnGeometry=false&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&f=html Query using object IDs: http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3/query?where=&text=&objectIds=3%2C+4&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=&returnGeometry=false&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&f=html
... View more
04-25-2013
08:11 AM
|
0
|
0
|
3085
|
|
POST
|
Jason, Try this: http://jsfiddle.net/NST5v/ Use dojo/ready to ensure that all modules have loaded and instead of parseOnLoad: true, manually call the parser. More info on dojo/domReady vs. dojo/ready: http://www.sitepen.com/blog/2013/04/17/dojodomready-vs-dojoready/
... View more
04-25-2013
08:04 AM
|
0
|
0
|
305
|
|
POST
|
The only client side conversion provided by the JS API is geographic (wgs84 AKA lat, long) to web mercator and vice versa. If you need to convert from something else, use the geometry service's project method.
... View more
04-24-2013
01:08 PM
|
0
|
0
|
461
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-23-2012 07:54 AM | |
| 1 | 05-28-2010 08:31 AM | |
| 1 | 11-12-2012 08:12 AM | |
| 3 | 02-23-2012 10:57 AM | |
| 1 | 06-27-2011 08:51 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|