+ Reply to Thread
Results 1 to 7 of 7

Thread: current view of map draw poly line and highlight layers

  1. #1
    naveen katta
    Join Date
    Oct 2011
    Posts
    8
    Points
    0
    Answers Provided
    0


    0

    Default current view of map draw poly line and highlight layers

    Hi All,

    I am trying to draw polyline and highligting layers with in current view of map using map.extent as geometry. But it is doing every thing fine but some times out side of rectangle layers are highlighting.

    I have drawn rectangle using below code:
    var graphic:Graphic = new Graphic();
    graphic.geometry = map.extent;
    graphic.symbol = sfs;
    graphicsLayer.add(graphic);

    Does map.extent will works for this scenario are I have to do some thing else?

    Thanks,
    Kumar

  2. #2
    naveen katta
    Join Date
    Oct 2011
    Posts
    8
    Points
    0
    Answers Provided
    0


    0

    Default Re: current view of map draw poly line and highlight layers

    Can any one please reply for above question??

    I am able to draw rectangle using above code but when i am highlighting the layers using same extent 1 or 2 records are highlighting out side of rectangle.

    Thanks,
    Kumar

  3. #3
    Robert Scheitlin

    Join Date
    Mar 2010
    Posts
    7,914
    Points
    4240
    Answers Provided
    709


    0
    This post is marked as the answer

    Lightbulb Re: current view of map draw poly line and highlight layers

    Kumar,

    When you get the selected graphics back just use the extents.contains method to check each graphic.

    Documentation:
    http://help.arcgis.com/en/webapi/fle...ry/Extent.html

    Don't forget to click the Mark as answer check on this post and to click the top arrow (promote) as shown below:
    Just because it's not the answer you want, does not mean that it is not the answer.

    Robert Scheitlin

    GIS Manager
    Calhoun County, Alabama


  4. #4
    naveen katta
    Join Date
    Oct 2011
    Posts
    8
    Points
    0
    Answers Provided
    0


    0

    Default Re: current view of map draw poly line and highlight layers

    Hi Robert,

    I have question about polygons and lines for current view of map. When ever the polygon is visible fully on the map, I am getting features count using queryTask.executeForCount() method but when ever i am zooming into that polygon layer ,I am not getting any features using same method.It is working for points. Only thing I observed is points we can see fully on the map, but polygons and lines if we zoom we can not see whole layer on the map....

    could you please help me on this??

    Thanks,
    Kumar.

  5. #5
    Robert Scheitlin

    Join Date
    Mar 2010
    Posts
    7,914
    Points
    4240
    Answers Provided
    709


    0

    Lightbulb Re: current view of map draw poly line and highlight layers

    Kumar,

    If you are looking for polygons that are in the view extent but not fully then you have to use the extent.intersects method instead, as the extent.contains will only find those polygons that are FULLY in the extent (meaning thier whole geometry).
    Just because it's not the answer you want, does not mean that it is not the answer.

    Robert Scheitlin

    GIS Manager
    Calhoun County, Alabama


  6. #6
    naveen katta
    Join Date
    Oct 2011
    Posts
    8
    Points
    0
    Answers Provided
    0


    0

    Default Re: current view of map draw poly line and highlight layers

    Thanks for your reply robert!!

    How can I apply extent.intersects method while doing queryTask.executeForCount(query,new AsyncResponder(onCountResult, onFault,paramData));

    I have query.geometry.extent but extent.intersects is Boolean So I am little bit confused to do this. I am already using Query.SPATIAL_REL_INTERSECTS for spatial relationship.

    Thanks,
    Naveen Kumar.

  7. #7
    Robert Scheitlin

    Join Date
    Mar 2010
    Posts
    7,914
    Points
    4240
    Answers Provided
    709


    0

    Question Re: current view of map draw poly line and highlight layers

    Naveen Kumar,

    I actually misunderstood the issue you were speaking of in your earlier post. I do not Know why you are not getting the polygon if it is in your view either partially or wholly when you use queryTask.executeForCount and have the querys spatialRelationship set to SPATIAL_REL_INTERSECTS.
    Just because it's not the answer you want, does not mean that it is not the answer.

    Robert Scheitlin

    GIS Manager
    Calhoun County, Alabama


+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts