I have an example, which is actually a copy of this ArcGIS example (http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/fl_popup.html), but like my other examples, I can't get it working with my examples.

There is samothingsomething like this: dojo.connect(map,"onClick",function(evt){ var query = new esri.tasks.Query(); query.geometry = pointToExtent(map,evt.mapPoint,10); var deferred = featureLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW); map.infoWindow.setFeatures([deferred]); map.infoWindow.show(evt.mapPoint); });

    dojo.connect(map,"onClick",function(evt){
      var query = new esri.tasks.Query();
      query.geometry = pointToExtent(map,evt.mapPoint,10);
      var deferred = featureLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW);
      map.infoWindow.setFeatures([deferred]);
      map.infoWindow.show(evt.mapPoint);
    });

    var template = new esri.InfoTemplate();
    template.setContent(getTextContent);

    var featureLayer = new esri.layers.FeatureLayer("http://servicesbeta.esri.com/arcgis/rest/services/SanFrancisco/SFStreetTreesRendered/MapServer/0",{
      mode: esri.layers.FeatureLayer.MODE_SELECTION,
      outFields: ["*"],
      infoTemplate:template
    });
    
    map.addLayer(featureLayer);

 function pointToExtent(map, point, toleranceInPixel) {
   var pixelWidth = map.extent.getWidth() / map.width;
   var toleraceInMapCoords = toleranceInPixel * pixelWidth;
   return new esri.geometry.Extent( point.x - toleraceInMapCoords,
                point.y - toleraceInMapCoords,
                point.x + toleraceInMapCoords,
                point.y + toleraceInMapCoords,
                map.spatialReference );                           
  }

When I tried to change the where condition for the query by myself like this: query.where = "Chripka.CISOKRES = 503 AND Chripka.STARTAGE = 6 AND Chripka.RANGEAGE = 8 AND Chripka.PERIODSTART >= date '10/13/2006' AND Chripka.PERIODSTART < date '10/20/2006'";

query.where = "Chripka.CISOKRES = 503 AND Chripka.STARTAGE = 6 AND Chripka.RANGEAGE = 8 AND Chripka.PERIODSTART >= date '10/13/2006' AND Chripka.PERIODSTART < date '10/20/2006'";

it did the job, because the query returned only one record, but that's the catch, I never know which region is selected, so this condition (Chripka.CISOKRES = 503) is unknown for me. So I tried this condition query.where = "Chripka.STARTAGE = 6 AND Chripka.RANGEAGE = 8 AND Chripka.PERIODSTART >= date '10/13/2006' AND Chripka.PERIODSTART < date '10/20/2006'";

query.where = "Chripka.STARTAGE = 6 AND Chripka.RANGEAGE = 8 AND Chripka.PERIODSTART >= date '10/13/2006' AND Chripka.PERIODSTART < date '10/20/2006'";

I have an example, which is actually a copy of this ArcGIS example (http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/fl_popup.html), but like my other examples, I can't get it working with my examples.

There is samothing like this: dojo.connect(map,"onClick",function(evt){ var query = new esri.tasks.Query(); query.geometry = pointToExtent(map,evt.mapPoint,10); var deferred = featureLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW); map.infoWindow.setFeatures([deferred]); map.infoWindow.show(evt.mapPoint); });

    var template = new esri.InfoTemplate();
    template.setContent(getTextContent);

    var featureLayer = new esri.layers.FeatureLayer("http://servicesbeta.esri.com/arcgis/rest/services/SanFrancisco/SFStreetTreesRendered/MapServer/0",{
      mode: esri.layers.FeatureLayer.MODE_SELECTION,
      outFields: ["*"],
      infoTemplate:template
    });
    
    map.addLayer(featureLayer);

 function pointToExtent(map, point, toleranceInPixel) {
   var pixelWidth = map.extent.getWidth() / map.width;
   var toleraceInMapCoords = toleranceInPixel * pixelWidth;
   return new esri.geometry.Extent( point.x - toleraceInMapCoords,
                point.y - toleraceInMapCoords,
                point.x + toleraceInMapCoords,
                point.y + toleraceInMapCoords,
                map.spatialReference );                           
  }

When I tried to change the where condition for the query by myself like this: query.where = "Chripka.CISOKRES = 503 AND Chripka.STARTAGE = 6 AND Chripka.RANGEAGE = 8 AND Chripka.PERIODSTART >= date '10/13/2006' AND Chripka.PERIODSTART < date '10/20/2006'";

it did the job, because the query returned only one record, but that's the catch, I never know which region is selected, so this condition (Chripka.CISOKRES = 503) is unknown for me. So I tried this condition query.where = "Chripka.STARTAGE = 6 AND Chripka.RANGEAGE = 8 AND Chripka.PERIODSTART >= date '10/13/2006' AND Chripka.PERIODSTART < date '10/20/2006'";

I have an example, which is actually a copy of this ArcGIS example http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/fl_popup.html, but like my other examples, I can't get it working with my examples.

There is something like this:

    dojo.connect(map,"onClick",function(evt){
      var query = new esri.tasks.Query();
      query.geometry = pointToExtent(map,evt.mapPoint,10);
      var deferred = featureLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW);
      map.infoWindow.setFeatures([deferred]);
      map.infoWindow.show(evt.mapPoint);
    });

    var template = new esri.InfoTemplate();
    template.setContent(getTextContent);

    var featureLayer = new esri.layers.FeatureLayer("http://servicesbeta.esri.com/arcgis/rest/services/SanFrancisco/SFStreetTreesRendered/MapServer/0",{
      mode: esri.layers.FeatureLayer.MODE_SELECTION,
      outFields: ["*"],
      infoTemplate:template
    });
    
    map.addLayer(featureLayer);

 function pointToExtent(map, point, toleranceInPixel) {
   var pixelWidth = map.extent.getWidth() / map.width;
   var toleraceInMapCoords = toleranceInPixel * pixelWidth;
   return new esri.geometry.Extent( point.x - toleraceInMapCoords,
                point.y - toleraceInMapCoords,
                point.x + toleraceInMapCoords,
                point.y + toleraceInMapCoords,
                map.spatialReference );                           
  }

When I tried to change the where condition for the query by myself like this:

query.where = "Chripka.CISOKRES = 503 AND Chripka.STARTAGE = 6 AND Chripka.RANGEAGE = 8 AND Chripka.PERIODSTART >= date '10/13/2006' AND Chripka.PERIODSTART < date '10/20/2006'";

it did the job, because the query returned only one record, but that's the catch, I never know which region is selected, so this condition (Chripka.CISOKRES = 503) is unknown for me. So I tried this condition

query.where = "Chripka.STARTAGE = 6 AND Chripka.RANGEAGE = 8 AND Chripka.PERIODSTART >= date '10/13/2006' AND Chripka.PERIODSTART < date '10/20/2006'";
added 153 characters in body
Source Link

P.S.Actually, the same question goes to TimeSlider. Is there a way to see, what query is executed behind the TimeSlider when its TimeExtent changes ?

P.S.Actually, the same question goes to TimeSlider. Is there a way to see, what query is executed behind the TimeSlider when its TimeExtent changes ?

edited tags
Link
PolyGeo
  • 63.3k
  • 27
  • 97
  • 304
Source Link
Loading