How to change point count use zoom level RRS feed

  • Question

  • Hi. I have 20k point and i must set it all as Pinpoint. But when I add all this point map work very very slow. I want do next. Add marker only for point in screen. When user zoom out I wand delete some markers(for example in current screen you see 20 markers. When you zoom out app must show you 50 Markers but I want show 25-30 point). I think I must get point distance between them less then some value(for example I'll show points with distance between them 500 meters). But I don't know how can I calculate this distance use zoom level Can any body help me? Thanks.
    • Moved by Ricky_Brundritt Saturday, March 10, 2012 10:04 AM (From:Bing Maps: Map Control and Web services Development)
    Thursday, July 21, 2011 8:15 PM


All replies

  • You can retrieve the bounding rectangle of the current map view by using map.getBounds() (

    This will give you a LocationRect formed from the coordinates at the corners of the map window - then (assuming your points are being retrieved from a database), only retrieve those points that lie within the LocationRect.

    twitter: @alastaira blog:
    Thursday, July 21, 2011 8:20 PM
  • Yes.

    But what happens when set zoom level to 1.

    I must show all this point. All 20k points.

    And when I start zooming map they will move very slov.

    I thik I must show only few points when zoom = 1

    when zoom = 2 I must show more  points...

    But I don't know how can I get points count for current zoomlevel.

    Friday, July 22, 2011 5:07 AM
  • Give pushpin clustering a try
    Hemant Goyal
    Friday, July 22, 2011 5:09 AM
  • Pushpin clustering might help at later zoom levels, but client-side clustering of 20,000 points is still going to be horrible performance-wise. Why do you have to show the pins at zoom level 1 - they won't possibly be separately discernible anyway. You can simply only start showing the pushpins at zoom levels >5, when the data volumes become more manageable.

    Alternatively, server-side clustering might help you or, if your data is relatively static, pre-generate a raster tileset for low zoom levels. i.e. At zoom levels 1-5, you effectively show a "picture" of the distribution of your pushpins, which gets replaced by actual pushpins as you zoom in.

    twitter: @alastaira blog:
    Friday, July 22, 2011 7:34 AM
  • Are you using AJAX or Silverlight. If you are using Silverlight try out this optimization:
    Windows Live Developer MVP - |
    Monday, July 25, 2011 4:53 PM