<!DOCTYPE html>
xmlns="http://www.w3.org/1999/xhtml">
<title>Много точек</title>
http-equiv="Content-Type" content="text/html; charset=utf-8" />
span>src="http://api-maps.yandex.ru/2.0-stable/?load=package.standard&lang=ru-RU" type="text/javascript">
span>type="text/javascript">
ymaps.ready(init);
var myMap,
myCollection;
function init()
{
myMap = new ymaps.Map ("map",
{
center: [55.76, 37.64],
zoom: 12,
behaviors: ['drag', 'scrollZoom', 'routeEditor']
} );
// точки
var coords = [ [55.745, 37.59],
[55.74, 37.60],
[55.74, 37.61],
[55.74, 37.62],
[55.74, 37.63],
[55.78, 37.59],
[55.78, 37.69] ];
var IEHeight = document.body.clientHeight
var GeoCol = new ymaps.GeoObjectCollection();
for (var i = 0; i < coords.length; i++)
{
GeoCol.add( new ymaps.Placemark(coords[i],
{
hintContent: 'hint'
,balloonContentHeader: 'balloonContentHeader'
,balloonContentBody: 'balloonContentBody'
,balloonContentFooter: 'balloonContentFooter'
} )
);
}
// При наведении на одну из меток подсвечиваем коллекцию целиком.
GeoCol.events
.add("mouseenter", function () { GeoCol.options.set("preset", "twirl#redIcon");} )
.add("mouseleave", function () { GeoCol.options.unset("preset");} );
myMap.geoObjects.add(GeoCol);
myMap.setBounds(myCollection.getBounds());
}
</head>
id ="map" style="width: 100%; height: 940px"></div>
</body>
</html>
|