none
Ajax7 Render a polygon with Interior Rings RRS feed

  • Question

  • How do I render a polygon with one or more interior rings in it? E.g. 'Armenia' or 'Azerbaijan'.

    I suppose I could just delete the interior ring out of the data... in my application it wouldn't make that much difference.


    Jonathon
    • Moved by Ricky_Brundritt Friday, March 9, 2012 2:11 PM (From:Bing Maps: Map Control and Web services Development)
    Friday, January 14, 2011 7:15 PM

Answers

  • Please see my reply in http://social.msdn.microsoft.com/Forums/en-US/vemapcontroldev/thread/ed756c03-13f3-4bee-b42d-d505326b05ec?prof=required
    Beginning Spatial with SQL Server http://www.apress.com/book/view/1430218290
    Saturday, January 15, 2011 9:54 AM
    Moderator

All replies

  • Please see my reply in http://social.msdn.microsoft.com/Forums/en-US/vemapcontroldev/thread/ed756c03-13f3-4bee-b42d-d505326b05ec?prof=required
    Beginning Spatial with SQL Server http://www.apress.com/book/view/1430218290
    Saturday, January 15, 2011 9:54 AM
    Moderator
  • Thanks tanoshimi,

    I didn't realize that his 'hollow' polygon example was an interior ring - I thought the line on the triangle in the bottom left meant that the triangle was 'open' (connected to the space outside the box. I'll give it a shot.

    Also, I appreciate all the replies to the other posts on the forum I've been reading. Thanks for your knowledge.


    Jonathon
    Saturday, January 15, 2011 1:12 PM
  • Ok, cool I've got it rendered!

    But I'm getting a line from the last interior ring back to the first point on the exterior (I guess this is the same as the screen shot in the other post).

    It doesn't look very good. Is there a way around it?

     


    Jonathon
    Saturday, January 15, 2011 2:42 PM
  • Try setting the strokeThickness of your polygon to 0 - the polygon fill should still work fine, but if you want interior holes you can't have the green line border.

    Beginning Spatial with SQL Server http://www.apress.com/book/view/1430218290
    Sunday, January 16, 2011 9:54 PM
    Moderator
  • If you want to also draw the lines you will need to break the polygon up into linear rings and create separate polyline objects. This is how we supported complex polygons in the past.
    Windows Live Developer MVP - http://rbrundritt.spaces.live.com | http://inknowledge.co.uk
    Tuesday, January 18, 2011 1:07 PM