none
Creating a static map with over 900 pushpins RRS feed

  • Question

  • I have a requirement to create  sales territory maps based upon zip codes.  The issue is that the territories range from 450 to over 900 zip codes.  

    I also need to create a bounding box for a territory.

    I need to use the REST API since I am developing an Azure API App using DocumentDB to  store almost 168,000 json documents.


    Howard S. Edidin MCTS BizTalk Server 2010 http://biztalkin-howard.blogspot.com/

    Monday, March 14, 2016 6:00 PM

Answers

  • The static map API only allows up to 100 pushpins per image request. Note that with 900 pushpins on a map, you likely won't be able to see most of the map, thus rendering it useless.

    You could use the Bing Maps JavaScript which can render over 1,000 pushpins, so that shouldn't be an issue. You could then take a screenshot of the map. If you wanted to render the actual polygon boundaries of the zip codes, that would be possible as well but would require rendering the data server side as a tile layer.

    Calculating the bounding box of your points is fairly easy. If using the JavaScript control, create an array of Location objects and pass it into the LocationRect.fromLocations function. It will generate a bounding box for you.

    Here is some documentation on the JavaScript API:

    https://msdn.microsoft.com/en-us/library/gg427610.aspx

    https://www.bingmapsportal.com/ISDK/AjaxV7


    http://rbrundritt.wordpress.com

    Monday, March 14, 2016 6:17 PM

All replies

  • The static map API only allows up to 100 pushpins per image request. Note that with 900 pushpins on a map, you likely won't be able to see most of the map, thus rendering it useless.

    You could use the Bing Maps JavaScript which can render over 1,000 pushpins, so that shouldn't be an issue. You could then take a screenshot of the map. If you wanted to render the actual polygon boundaries of the zip codes, that would be possible as well but would require rendering the data server side as a tile layer.

    Calculating the bounding box of your points is fairly easy. If using the JavaScript control, create an array of Location objects and pass it into the LocationRect.fromLocations function. It will generate a bounding box for you.

    Here is some documentation on the JavaScript API:

    https://msdn.microsoft.com/en-us/library/gg427610.aspx

    https://www.bingmapsportal.com/ISDK/AjaxV7


    http://rbrundritt.wordpress.com

    Monday, March 14, 2016 6:17 PM
  • Is there any way to get the bounding box coordinates from the zip codes?

    Can I create a static map without the pushpins and just show the zip code with a color overlay?

    Thanks,

     

    Howard S. Edidin MCTS BizTalk Server 2010 http://biztalkin-howard.blogspot.com/

    Monday, March 14, 2016 8:42 PM