var query = new Query(); query.geometry = pointToExtent(map, evt.mapPoint, 20);
map.on("click", function(e) { map.graphics.clear(); // create an extent var pad = map.extent.getWidth() / 10; var extent = new Extent( e.mapPoint.x - pad, e.mapPoint.y - pad, e.mapPoint.x + pad, e.mapPoint.y + pad, map.spatialReference ); // add the extent as a graphic map.graphics.add(new Graphic( extent, new SimpleFillSymbol().setColor(null).outline.setColor("#fff") )); var q = new Query(); q.geometry = extent; featureLayer.queryFeatures(q).then( function(result) { console.log("query result", result); }, function(error) { console.log("query error", error); } ); });
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.