Well, I've implemented a slightly different approach to this. It was just a fun exercise, but I'm displaying all my data (about 140.000 points) in Bing Maps using the HTML5 canvas.
I previously load all the data to the client. Then, I've optimized the drawing process so much that I've attached it to the "Viewchange" event (which fires all the time during the view change process).
I've blogged about this. You can check it here.
My example does not have interaction on it but could be easily done (should be a nice topic for a blog post). You would have thus to handle the events manually and search for the corresponding points yourself or, if the amount of points to draw and/or the zoom level was below some threshold, show regular pushpins.
Anyway, another option, if you're not restricted to Bing Maps, is to use the likes of Leaflet. It allows you to create a Canvas Layer which is a tile-based layer but rendered in client-side using HTML5 canvas. It opens a new range of possibilities. Check for example this map in GisCloud.
Yet another option, although more suitable to static data, is using a technique called UTFGrid. The lads that developed it can certainly explain it better than me, but it scales for as many points as you want with a fenomenal performance. It consists on having a tile layer with your info, and an accompanying json file with something like an "ascii-art" file describing the features on the tiles. Then, using a library called wax it provides complete mouse-over, mouse-click events on it, without any performance impact whatsoever.
I've also blogged about it.
Best Answer
I'm putting everything in the
<body>
for demonstration purposes. You'd probably put the loading of the externalmapcontrol
library and yourGetMap()
function in the<head>
. You might even want to put your own script in an external file.The parameters for VEMap.LoadMap(VELatLong, zoom, style, fixed, mode, showSwitch, tileBuffer, mapOptions) are:
VELatLong A VELatLong Class object that represents the center of the map. Optional.
zoom The zoom level to display. Valid values range from 1 through 19. Optional. Default is 4. Note that VEMapStyle.Birdseye seems to only support two zoom levels: 1 gives you the wide view, anything else gives you the close-up view.
style A VEMapStyle Enumeration value specifying the map style. Optional. Default is VEMapStyle.Road. I changed this to VEMapStyle.Birdseye as documented at VEMapStyle.
fixed A Boolean value that specifies whether the map view is displayed as a fixed map that the user cannot change. Optional. Default is false.
mode A VEMapMode Enumeration value that specifies whether to load the map in 2D or 3D mode. Optional. Default is VEMapMode.Mode2D.
showSwitch A Boolean value that specifies whether to show the map mode switch on the dashboard control. Optional. Default is true (the switch is displayed).
tileBuffer How much tile buffer to use when loading map. Default is 0 (do not load an extra boundary of tiles). This parameter is ignored in 3D mode.
mapOptions A VEMapOptions Class that specifies other map options to set.
Lastly, the Bing Maps Interactive SDK is a great resource for playing around and trying to figure out how things work and the Bing Map Control Class Reference documents the entire API.