Solved! Go to Solution.
function selectParcel(parcelid) {
if (parcelid) {
var query = new Query();
query.where = "PARCELID = '" + parcelid + "'";
var deferred = parcels.selectFeatures(query, FeatureLayer.SELECTION_NEW, function (selection) {
var center = graphicsUtils.graphicsExtent(selection).getCenter();
// add parcel to browser history
var apn = selection[0].attributes.APN;
if ((typeof history.pushState !== "undefined") && (apn)) {
window.history.pushState(null, null, "?getParcel=" + apn);
}
var extHandler = map.on("extent-change", function () {
extHandler.remove();
//zoom to the center then display the popup
map.infoWindow.setFeatures(selection);
map.infoWindow.show(center);
});
map.centerAt(center);
});
}
}