none
Polygons sluggish pan and zoom

    Question

  • Hi

    I have loaded 155 polygons, based upon a buffer of 5 miles from our SQL database and for each polygon set its fill colour depending on the a banding value (demographic map) - once the polygons are rendered onto the map, the pan and zoom functionality becomes very sluggish - testing the map using IE9 and visual studio debug mode - any ideas on how I can speed up the pan and zoom - ( ideally I would like to treat the polygons as one object, once they are drawn, I would assume that the map could redraw this faster than individual polygons)

    on another note, does anyone have any links or resources where I can try and match some HEX colours to maps.color - my designer has given me the hex values, but I am not having any luck matching them to argb and I am required to display a legend of the colours and values from the demographics - the hex values are

    #1a5c96, #2750b1, #2b84d2, #60a3dd, #95c1e8, #cae0f4

    Many thanks

    Richard


    Richard Steele

    Tuesday, July 09, 2013 12:14 PM

Answers

  • The polygons likely have a lot of coordinates in them due to the Buffer in SQL. If you reduce the resolution of the buffer by either using the Reduce method or by using BufferWithTolerance you will be able to generate similar shapes with less coordinates. This will be the first thing to look into. To get an idea of how many coordinates there are in a shape use the STNumPoints method in SQL.

    If you need a lot of high resolution polygons then you will have to look into turning your shapes into an image and overlay that on top of the map. Take a look at this project as an example: http://ajaxmapdataconnector.codeplex.com/

    As for getting the RGB color values from a hex color. Try this tool: http://www.javascripter.net/faq/hextorgb.htm


    http://rbrundritt.wordpress.com

    Wednesday, July 10, 2013 12:33 PM

All replies

  • The polygons likely have a lot of coordinates in them due to the Buffer in SQL. If you reduce the resolution of the buffer by either using the Reduce method or by using BufferWithTolerance you will be able to generate similar shapes with less coordinates. This will be the first thing to look into. To get an idea of how many coordinates there are in a shape use the STNumPoints method in SQL.

    If you need a lot of high resolution polygons then you will have to look into turning your shapes into an image and overlay that on top of the map. Take a look at this project as an example: http://ajaxmapdataconnector.codeplex.com/

    As for getting the RGB color values from a hex color. Try this tool: http://www.javascripter.net/faq/hextorgb.htm


    http://rbrundritt.wordpress.com

    Wednesday, July 10, 2013 12:33 PM
  • many thanks for your reply - I will try this approach and let you know how I get on

    Thanks


    Richard Steele

    Friday, July 12, 2013 8:36 AM