<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script src="http://api-maps.yandex.ru/2.0/?load=package.full&lang=ru-RU" type="text/javascript"></script>
<style type="text/css">
html, body, #map {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
</style>
<script type="text/javascript">
var myMap;
var myPolygon;
var myButton;
// Дождёмся загрузки API и готовности DOM.
ymaps.ready(init);
function init () {
myMap = new ymaps.Map('map', {
center:[55.74131, 37.52620],
zoom:16
});
myMap.behaviors.enable('scrollZoom');
myMap.controls.add(
new ymaps.control.ZoomControl()
);
myMap.controls.add('typeSelector');
//второй контур
function AddPolygon(Att, Latt, Name, Descr) {
myPolygon = new ymaps.Polygon([
[
[Att, Latt]
],
], {
balloonContent: Name,
hintContent: Descr
}, {
fillColor: 'FF3030',
strokeColor: '#CD2626',
opacity: 0.5,
strokeWidth: 1.5,
strokeStyle: 'solid'
});
myMap.geoObjects.add(myPolygon);
myMap.setBounds(myPolygon.geometry.getBounds());
//myPolygon.options.set("zIndex",750)
return myPolygon;
}
function AddGroup(Att, Latt, Name, Descr) {
}
//Создаем кнопку
myButton = new ymaps.control.Button('<b>Редактировать контур<b>');
myButton.events
.add('click', function () {})
.add('select', function () {myPolygon.editor.startEditing();})
.add('deselect', function () {myPolygon.editor.stopEditing();});
myMap.controls.add(myButton);
}
</script>
</head>
<body>
<div id="map"></div>
</body>
</html> |