EXAMPLE:
I want to get the same result as the example.
I'm doing wrong.?
var queryTaskGeoCatmin = new QueryTask("http://geocatmin.ingemmet.gob.pe/arcgis/rest/services/SERV_CARTOGRAFIA_DEMARCACION_WGS84/MapServer/0");
var queryGeocatmin = new Query();
queryGeocatmin.outSpatialReference = [{wkid:4326}];
queryGeocatmin.SpatialRelationship = "esriSpatialRelIntersects";
queryGeocatmin.geometryType = "point";
queryGeocatmin.geometry ={f: "json", x :-75.954001, y :-7.740334};
queryGeocatmin.outFields = ["*"];
queryTaskGeoCatmin.execute(queryAmbito, resultGeocatmin);
function resultGeocatmin(queryAmbito){
console.log(queryAmbito);
}
Heber,
You have some of your properties wrong:
var queryGeocatmin = new Query(); queryGeocatmin.outSpatialReference = new esri.SpatialReference({wkid:4326}); queryGeocatmin.SpatialRelationship = esri.tasks.Query.SPATIAL_REL_INTERSECTS; queryGeocatmin.geometry = new esri.geometry.point(-75.954001,-7.740334, new esri.SpatialReference({ wkid: 4326 })); queryGeocatmin.outFields = ["*"]; queryTaskGeoCatmin.execute(queryAmbito, resultGeocatmin);