Great posts in the forum I thought i would share here
Best Practices for Virtual Earth development (AJAX control)
General
1. To ensure proper rendering of the map use the following meta-tag and DOCTYPE:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
2. Always specify a position, width, and height style property for the map div.
3. If possible specify starting coordinate and zoom level in the VEMap.LoadMap method. This will reduce the number of unneeded tiles that are loaded.
4. If a lot of panning is expected then set the tileBuffer property of the VEMap.LoadMap method for better user experience.
5. Minify JavaScript files and CSS style sheets.
6. If making multiple Find calls in sequence use recursion: http://rbrundritt.spaces.live.com/blog/cns!E7DBA9A4BFD458C5!739.entry
7. Use VEMap.SetCenterAndZoom function instead of two separate function calls to VEMap.SetCenter and VEMap.SetZoom.
8. Use VEMap.Dispose map on page unload to release browser resources.
9. If loading multiple shape layers and allowing user to switch between layers then hide/show layers rather than deleting and reloading.
10. UseVEMap. onLoadMap property to process post map load functions: http://msdn.microsoft.com/en-us/library/bb412504.aspx
11. Hide birdseye pop-up for better user experience:
document.getElementById(‘MSVE_obliqueNotification’).style.display = “none”;
document.getElementById(‘MSVE_obliqueNotification’).style.visibility = “hidden”;
12. Create custom navigation dashboard rather than modifying the existing one. This will make it easier to migrate to newer versions of the map control.
13. If 3D is not required then disable hotkeys (the number 3), and hide the 3D button. This will ensure that the user will not accidentally navigate into 3D.
Rather than hide the 3D button (using CSS), you should set the showSwitch parameter of the LoadMap() method to false. (I'm sure this is what you meant, but just to clarify)
14. If expecting user to only search within one country then append the country’s name to the end of all addresses being used in find searches if the user has not already specified the country. This will prevent Virtual Earth from searching against the worldwide data and will increase the chances of relevant results being returned. The same applies for addresses being used for driving directions.
15. If user is required to scroll the web page to see the map, then consider disabling the mouse scroll wheel event on the map. This will keep the user from accidentally zooming the map.
16. Disable the VE disambiguation box that occurs for find searches and create your own. This will give you the developer greater control over its functionality.
17. Ensure to enable printing for maps that the users may print. http://msdn.microsoft.com/en-us/library/cc469977.aspx
18) Add the following to the <head> of your web page:
<meta http-equiv="Accept-Encoding" content="gzip, deflate" />
This will also help when you're serving vector data via AJAX - but don't forget to set your web server compression on.
Shapes only in 2D:
1. add pushpins to a div rather than a VEShapeLayer for performance increases: http://blogs.msdn.com/virtualearth/archive/2009/04/09/virtual-earth-api-release-information-april-2009.aspx
2. If you need a custom pop-up, overlay an absolutely positioned div over the map and move it around. Otherwise use the custom the VEMap.ClearInfoBoxStyles method and specify your own styles. http://msdn.microsoft.com/en-us/library/bb412441.aspx
3. Disable shape display threshold when working with only a few polygons/polygons so that there is no loss in shape precision: http://msdn.microsoft.com/en-us/library/bb964367.aspx
Shapes in 3D
1. 1. Always use the VECustomIconSpecification for custom pushpins.
VECustomIconSpecification
1. 1. Use an absolute path for icon images.
2. 2. If not using the TextContent property of the VECustomIconSpecification, add a space character instead of an empty string. This is a work around for a bug in VE.
Data
1. Ensure that client data is in the proper projection system, WGS84. NAD83 will also work (~1m offset from WGS84 in certain areas of the world).
Absolutely! It might be worth mentioning that if you do have data projected in NAD27, or the British National Grid, for example, then you can reproject it into WGS84 using freely-available FWTools (http://fwtools.maptools.org/)
2. Use AJAX to retrieve data rather than post backs. This will allow you to retrieve your data without having to reload the map. This is much faster.
3. When working with latitude and longitude coordinates only six decimal places are needed. Any more decimal places will not change the pixel position on the map. This will reduce the overall size of the data being retrieved.
4. If there are a lot of pushpins (20+) on the map then clustering should be used.
a. If there is 100 of less pushpins then use the VEClusterSpecification: http://msdn.microsoft.com/en-us/library/bb412546.aspx
b. If there are 100 – 1000 pushpins use custom client side clustering algorithm: http://msdn.microsoft.com/en-us/library/cc161072.aspx
c. If there are 1000+ pushpins use server side clustering (many algorithms exist)
5. Watch for floating point issues when doing calculations with coordinates. http://en.wikipedia.org/wiki/Floating_point#Problems_with_floating-point
6. When there is a lot of data, only load data for the current map view. Update data as the user navigates the map.
7. If possible run ESRI shapefile polygons/polyline data through a reduction algorithm to reduce the number of coordinates used to represent the shapes. ESRI shapefiles typically are large and use multiple coordinates (20+) to represent a straight line when only two are needed.
I agree with the comment that shapefiles should be reduced, but we need to be careful about the concept of 'straight lines' and how many coordinates are needed... because I would argue that it is Virtual Earth that handles these incorrectly rather than shapefiles.
Consider an ESRI shapefile with a single 'straight' linestring drawn between two coordinates at (34, -118) and (52 ,0), representing a route between Los Angeles and London. These coordinates are measured in WGS84, which uses geographic coordinates on an ellipsoidal model of the Earth. The shortest 'straight' line route between these two points, when projected onto a Mercator map, is therefore:
8. Polygon and Polyline data can be encoded to reduce its size: http://www.soulsolutions.com.au/Articles/Encodingforperformance.aspx
9 "If plotting complex shapes that are relatively static, and which you don't need to be able to interact with, use a tile layer rather than a shape layer."
10 "To generate your own background tiles you can use MSR mapcruncher. If you want to replace the default VE tileset completely with your own tiles then set the LoadBaseTiles map option to false when calling the LoadMap method"
Most of this came from the most awsome
and some from the sql spatial guru himselft
Ricky Brundritt
http://rbrundritt.spaces.live.com/default.aspx?sa=324131751
aitchison
http://www.beginningspatial.com/
Great Job