inpixie

convert Select features via url parameter from MapService to WebMap

Discussion created by inpixie on Mar 27, 2012
i want to convert Select features via url parameter from MapService to WebMap in this page http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/exp_history.html.

I've changed using esri.arcgis.utils.createMap and stored it in variable map, but I can't alter the function of the coding below.



//select parcel from the feature layer by creating a query to look for the input parcel id
      function selectParcel(parcelid) {
        if (parcelid) {
          var query = new esri.tasks.Query();
          query.where = "PARCELID = '" + parcelid + "'";
          var deferred = parcels.selectFeatures(query, esri.layers.FeatureLayer.SELECTION_NEW, function (selection) {
            var center = esri.graphicsExtent(selection).getCenter();
            var extHandler = dojo.connect(map, 'onExtentChange', function () {
              dojo.disconnect(extHandler);
              //zoom to the center then display the popup
              map.infoWindow.setFeatures(selection);
              map.infoWindow.show(center);
            });
            map.centerAt(center);
          });

        }

      }



is there any alternative not to use parcels.selectFeatures? whether parcels.selectFeatures only applies to mapservice? what the successor function for webmap ArcGIS?. thank you

Outcomes