<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru" lang="ru">
<head>
    <title>Правила землепользования и застройки г.о. Королёв</title>
    <script src="https://api-maps.yandex.ru/1.1/index.xml?key=AEnoMVgBAAAAe0IwAQIAalbXEXjFHBFrFSmiMh7PtE4JvvUAAAAAAAAAAACr4kfG3ruGa63Zl84UIUelddwgnQ==" type="text/javascript"></script>
    <script type="text/javascript">
        window.onload = function () {
            var options = {
                    tileUrlTemplate: "http://map.genplankorolev.ru/2018/PZZ/%z/tile-%x-%y.png",
                    controls: {
                        typeControl: false,
                        miniMap: false,
                        toolBar: false,
                        scaleLine: false
                    },
                    scrollZoomEnabled: true,
                    mapCenter: new YMaps.GeoPoint(-179.99709835247, 85.0833669019063),
                    backgroundMapType: YMaps.MapType.NONE,
                    mapZoom: 19,
                    isTransparent: false,
                    smoothZooming: false,
                    layerKey: "my#layer",
                    mapType: {
                        name: "Правила землепользования и застройки г.о. Королёв",
                        textColor: "#000000"
                    },
                    copyright: ""
                },
                map = new YMaps.Map(document.getElementById("YMapsID")),
                myData = new YMaps.TileDataSource(options.tileUrlTemplate, options.isTransparent, options.smoothZooming);

            myData.getTileUrl = function (tile, zoom) {
                return this.getTileUrlTemplate().replace(/%x/i, tile.x).replace(/%y/i, tile.y).replace(/%z/i, zoom);
            }

            var MyLayer = function () {
                return new YMaps.Layer(myData);
            }
            YMaps.Layers.add(options.layerKey, MyLayer);

            var mapLayers = options.backgroundMapType ? options.backgroundMapType.getLayers() : [],
                myMapType = new YMaps.MapType(YMaps.jQuery.merge(mapLayers, [ options.layerKey ]), options.mapType.name, { textColor: options.mapType.textColor });

            map.setCenter(options.mapCenter, options.mapZoom, myMapType);
            if (options.copyright) {
                map.addCopyright(options.copyright);
            }

            if (options.controls.typeControl) {
                map.addControl(new YMaps.TypeControl([ myMapType, YMaps.MapType.MAP, YMaps.MapType.SATELLITE, YMaps.MapType.HYBRID ], [1, 2, 3]));
            }
         
            if (options.controls.miniMap) {
                map.addControl(new YMaps.MiniMap());
            }
            if (options.controls.toolBar) {
                map.addControl(new YMaps.ToolBar());
            }
            if (options.controls.scaleLine) {
                map.addControl(new YMaps.ScaleLine());
            }
            if (options.scrollZoomEnabled) {
                map.enableScrollZoom();
            }
            map.addControl(new YMaps.Zoom());
            map.setMaxZoom(19)
            map.setMinZoom(18)
        }
    </script>
</head>
<body>
    <div id="YMapsID" style="width:100%;height:87vh"></div>
</body>
</html>