Virtual Earth and KML
I recently learned that the Virtual Earth vector generalization issue that I discovered earlier to has at least been partly remedied in a fix that Microsoft recently rolled out, by allowing developers to turn it off: One of my colleagues has however reported that he's still seeing some generalization issues in GeoRSS at some zoom levels despite the display threshold setting. Bug Fixes: New Features/Functionality: To Be Fixed/Updated: Not Fixed:
From this (note the significant gaps and overlaps):
To this:
Gaps and overlaps no longer occur, and polygons are now true to the source KML.
This just came out as a fix issued November 16, and is implemented via a VEMap method: map.EnableShapeDisplayThreshold(false); However, I noted that the VE team still needs to fix the generalization algorithm that’s still being implemented by default or when map.EnableShapeDisplayThreshold is set to true.
Per a forum post by the VE developer team (note that it also includes some other recently announced enhancements as well):
The Virtual Earth v6 API has been updated. The below list is not comprehensive. However, it talks about the bugs that has been dicussed on the forums.
You can try it out using the following example(please enter your own kml url). Please note that source parameter in VEShapeSourceSpecification needs to be a URL. Local files are not supported.Code Block
var spec = new VEShapeSourceSpecification(VEDataType.ImportXML, http://enteryourkmlurlhere.htm");
map.ImportShapeLayerData(spec);
This is not in the documentation yet, but the following needs to be set for the GetDirections to return localized results:Code Block
var options = new VERouteOptions();
options.UseMWS = true;
map.GetDirections(['redmond,wa','seattle,wa'],options);
//The UseMWS flag uses the MapPoint Web Service routing engine which provides localized
results. However, the generated route might be slightly different from the default routing engine’s route.
If you’re seeing polygons/polylines being drawn incorrectly, do the following.Code Block
map.EnableShapeDisplayThreshold(false);
Workaround: Changing the order of how you load the map might solve the problem. i.e. Loading the second map before the first map will prevent this from happening.
If you order of the map div on the page look like this:
Div 1 (id='myMap1')
Div 2 (id='myMap2')
In you script do this instead:Code Block
map2 = new VEMap('myMap2');
map2.LoadMap();
map1 = new
VEMap('myMap1');
map1.LoadMap();Code Block
//This code is only nessecary for v5 mapcontrol when in 3D mode
//However, This will not work for when -3.142 < lat < -3.142 = 180 e.latLong.Longitude <= -180 e.latLong.Longitude >= 180))
{
//Convert latlong to a valid latlong
var r2d = 180.0 / Math.PI;
e.latLong = new
VELatLong(e.latLong.Latitude / r2d, e.latLong.Longitude / r2d);
}










0 Comments:
Post a Comment
Links to this post:
Create a Link
<< Home