У меня есть приложение с управлением Virtual Earth V6.3, использующее чистый javascript для добавления ломаной линии, как показано в следующем примере фрагмента кода, встроенного в одну веб-страницу HTML5:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>VE Map with Polyline</title>
<script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.3"></script>
<script type="text/javascript">
function MapLoad() {
// load map
var _map = new VEMap('Map');
_map.LoadMap();
// center point in NY City
var _center = new VELatLong(40.75, -73.99);
// zoom level
_map.SetCenterAndZoom(_center, 14);
// set Map style
_map.SetMapStyle(VEMapStyle.Shaded);
// polyline layer
var _layerPolyline = new VEShapeLayer();
// sample polyline array of coordinates
var _arrPoints = [];
_arrPoints.push(new VELatLong(40.78, -73.984));
_arrPoints.push(new VELatLong(40.76, -73.989));
_arrPoints.push(new VELatLong(40.75, -73.99));
_arrPoints.push(new VELatLong(40.74, -73.991));
_arrPoints.push(new VELatLong(40.73, -73.992));
_arrPoints.push(new VELatLong(40.72, -73.993));
_arrPoints.push(new VELatLong(40.72, -73.994));
_arrPoints.push(new VELatLong(40.73, -73.995));
_arrPoints.push(new VELatLong(40.73, -73.996));
_arrPoints.push(new VELatLong(40.74, -73.997));
// polyline object properties
var _polyLine= new VEShape(VEShapeType.Polyline, _arrPoints);
_polyLine.HideIcon();
_polyLine.SetLineColor(new VEColor(0, 0, 255, 1));
_polyLine.SetFillColor(new VEColor(0, 0, 255, 0));
_polyLine.SetLineWidth(4);
// add polyline to layer
_layerPolyline.AddShape(_polyLine);
// add layer to map
_map.AddShapeLayer(_layerPolyline);
}
</script>
</head>
<body onload="MapLoad();">
<div id="Map" style="position:absolute; height:98%; width:98%;"></div>
</body>
</html>
Он отлично работает на любом уровне масштабирования. Однако, по сути, тот же самый код дает странные результаты в реальном приложении при использовании веб-форм ASP.NET 4.5, а именно: ломаная линия исчезает при высоком уровне масштабирования (примерно выше 15).
Вопрос. Есть идеи относительно основной причины проблемы и способов ее устранения? Спасибо.
ОБНОВЛЕНИЕ: Проблема решена путем обновления до Bing Maps AJAX Control, версия 7.0 (работает: DEMO: полилиния маршрута автобуса видна при любом уровне масштабирования). Спасибо Рики Брандритт (@rbrundritt).