Thanks, that should be what i was looking for... but... i see SQL syntax is used... and functionality that i have to provide to my users is that they can select (checkbox) or deselect each POI in some list/filter (one or couple of thousands) and when they do... i have toshow only the selected POIs... so sending like 1000+ ID or even more than 10000 (ID = min. 5 digit number plus comma) in WHERE condition... that could be a problem 🙂
var aObjectIds = []; aObjectIds.push(12345); aObjectIds.push(67890); detailQueryTask = new esri.tasks.QueryTask(mapServiceName); detailQuery = new esri.tasks.Query(); detailQuery.objectIds = aObjectIds; detailQuery.returnGeometry = true; detailQuery.outFields = ["*"]; detailQueryTask.execute(detailQuery, function (results) { doSomething(results); if (results.features !== undefined && results.features.length !== 0) { zoomToPointFeaturesExtent(results); highlightMonuments(results, "STYLE_SQUARE"); } function zoomToPointFeaturesExtent(results) { var xtent, xmin = results.features[0].geometry.x, ymin = results.features[0].geometry.y, xmax = results.features[0].geometry.x, ymax = results.features[0].geometry.y; dojo.forEach(results.features, function (feature) { if (feature.geometry.x > xmax) { xmax = feature.geometry.x; } if (feature.geometry.y > ymax) { ymax = feature.geometry.y; } if (feature.geometry.x < xmin) { xmin = feature.geometry.x; } if (feature.geometry.y < ymin) { ymin = feature.geometry.y; } }); xtent = new esri.geometry.Extent(xmin, ymin, xmax, ymax, map.spatialReference); map.setExtent(xtent, true); } function highlightMonuments(results, markerType) { map.graphics.clear(); var symbol = new esri.symbol.SimpleMarkerSymbol(); symbol.setOutline(new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0, 255, 255, 1.0]), 3)); symbol.setStyle(esri.symbol.SimpleMarkerSymbol[markerType]); symbol.setColor(new dojo.Color([0, 255, 255, 0.0])); // hollow center, fully transparent symbol.setSize(10); var geom; dojo.forEach(results.features, function (value) { geom = value.geometry; var graphic = new esri.Graphic(geom, symbol); map.graphics.add(graphic); }); }
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.