Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

First post - apologies if it's a simple question!

I am basically looking to have a JS API service which will populate a datagrid with all of the points visible in the current map extent. As a user zooms in or out, the number of records returned will change to reflect what is in the current extent.

I have been looking at the findPointsInExtent examples in the esri JavaScript examples, but am not sure how to edit the these examples to go from a user defined rectangle to the map extent as described above.

Many thanks,

share|improve this question

1 Answer 1

When you create map object, you can specify the extends as below:

 map = new esri.Map("map", {
          extent: esri.geometry.geographicToWebMercator(new esri.geometry.Extent(-125.90, 44.60, -114.65, 50.22, new esri.SpatialReference({wkid:4326}))),
          showInfoWindowOnClick:false
        });

Then latter you can change the map extends values as below:

http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi_start.htm#jsapi/map.htm#setExtent

map.setExtent(taxLotExtent);
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.