Microsoft Developer Network >
Forums Home
>
Windows Live Developer Forums Forums
>
Bing Maps: Map Control Development
>
Shape Layers Limitation
Shape Layers Limitation
- Hi,
Is there any limitations for adding number of shape layers in the bing map? As I need to add more than 50 shape layers in the bing map.
Also please let me know more than 50 shape layers will degrade the performance of the map?
Thanks
krishna
Answers
- I'm not aware of any hard-coded limits for the number of shape layers that you can add to the map, but obviously every additional layer will degrade map performance (i.e. increase memory usage, slow down rendering etc.).
If you require more than 50 shape layers, you might want to think about using the Silverlight control rather than the Javascript control because I suspect you will get better performance.
Beginning Spatial with SQL Server http://www.apress.com/book/view/1430218290- Marked As Answer byRichard_BrundrittMVP, ModeratorFriday, November 20, 2009 5:19 AM
- I don't believe their is a limitation either. However having 50 shape layers seems a bit extreme. I would expect this many shape layers to have the potential to cause performance issues depending on the number of shapes on each layer. Perhaps there is a better way to accomplish what it is your looking to do. If you give us a summary of what it is your looking to do we may be able to give you some pointers on best practices.
Windows Live Developer MVP - http://rbrundritt.spaces.live.com- Marked As Answer byRichard_BrundrittMVP, ModeratorFriday, November 20, 2009 5:19 AM
All Replies
- I'm not aware of any hard-coded limits for the number of shape layers that you can add to the map, but obviously every additional layer will degrade map performance (i.e. increase memory usage, slow down rendering etc.).
If you require more than 50 shape layers, you might want to think about using the Silverlight control rather than the Javascript control because I suspect you will get better performance.
Beginning Spatial with SQL Server http://www.apress.com/book/view/1430218290- Marked As Answer byRichard_BrundrittMVP, ModeratorFriday, November 20, 2009 5:19 AM
- I don't believe their is a limitation either. However having 50 shape layers seems a bit extreme. I would expect this many shape layers to have the potential to cause performance issues depending on the number of shapes on each layer. Perhaps there is a better way to accomplish what it is your looking to do. If you give us a summary of what it is your looking to do we may be able to give you some pointers on best practices.
Windows Live Developer MVP - http://rbrundritt.spaces.live.com- Marked As Answer byRichard_BrundrittMVP, ModeratorFriday, November 20, 2009 5:19 AM
- Hi Richard,
I have around 50 main categories and each main categories are having sub categories(around 350 ICONs). In the same page a panel will show 50 main categories as checkboxes. If I tick a main category, the corresponding subcategories should be bound on the map. If I untick the subcategory, the corresponding subcategories should be removed from the map. For this case I am planning to create each layer for each main category.
So that the layer can be hidden/visible based on the check box tick status.
krishna - Here is the issue, 50 x 350 = 17500 shapes. The map gets slow when there is upwards of 200 shapes. Showing just one layer will start to slow the map down. Rather than using layers I would suggest storing your data in arrays. When a user turns on a layer create the shapes from the data in the corresponding array. Only show one layer at a time. Doing these two things will significantly improve performance. If you go this route you will only need one shape layer to show your locations, and you can update the data on that layer.
Windows Live Developer MVP - http://rbrundritt.spaces.live.com

