window.src_marker = '/i/map/bullet_01.png'; window.src_marker_active = '/i/map/bullet_01.png'; window.src_marker_deactive = '/i/map/bullet_02.png'; window.corn_y = -23 + 16; window.corn_y_ = 16; // 66 + 71 - 18 window.corn_x = 73 + 16; window.corn_x_ = 310 + 16; window.minZoom = 8; window.manZoom = 16; window.filter = true;(function(){ /** * Constructor */ ArendaMap = function() { this.scope = this; this.mapContainerSelector = null; this.filterAreaSlider = $('#filter-slider'); this.areaMaxInput = $( "#area-max" ) this.areaMinInput = $( "#area-min" ) this.maxArea = 2000; this.minArea = 0 this.currentMinArea = this.getCookie('areaMin') || 0; this.currentMaxArea = this.getCookie('areaMax') || 2000; this.map = null; this.mapOptions = null; this.currentLocation = null; this.markers = {}; this.markersArray = []; this.markerDefaultMode = this.getCookie('mode') || 'all'; this.markerMode = this.markerDefaultMode; this.MOVE_DIRECTION = 50; this.list = []; this.data = {"moscow":{"lat":"55.704986","lng":"37.615814","city":"moscow","zoom":10,"items":{"item1":{"lat":"55.736994923104","lng":"37.690280690193","index":1,"title":"\u0411\u0438\u0437\u043d\u0435\u0441 - \u0446\u0435\u043d\u0442\u0440 \u043d\u0430 \u041d\u0438\u0436\u0435\u0433\u043e\u0440\u043e\u0434\u0441\u043a\u043e\u0439","area":"25423","photo":"\/upload\/resize_cache\/iblock\/f2d\/70_70_2\/3fd43ff91b3303d5e101e51e2c6cb4ef.jpg","address":"\u0443\u043b. \u041d\u0438\u0436\u0435\u0433\u043e\u0440\u043e\u0434\u0441\u043a\u0430\u044f, 32 (\u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438)","href":"\/rent\/object.html?ID=10944","type":"office","blocks":[{"area":20.5,"type":"office"},{"area":34.05,"type":"office"},{"area":36.4,"type":"office"},{"area":105.17,"type":"office"},{"area":18.59,"type":"office"},{"area":178.64,"type":"office"},{"area":77.84,"type":"office"},{"area":76.38,"type":"office"},{"area":50.29,"type":"office"},{"area":178.75,"type":"office"},{"area":151.42,"type":"office"},{"area":36.4,"type":"office"},{"area":57.34,"type":"office"},{"area":76.72,"type":"office"},{"area":32.48,"type":"office"},{"area":413.06,"type":"office"},{"area":152.77,"type":"office"},{"area":30.46,"type":"office"},{"area":70.45,"type":"office"},{"area":18.26,"type":"office"},{"area":53.09,"type":"office"},{"area":19.38,"type":"office"},{"area":52.08,"type":"office"},{"area":51.63,"type":"office"},{"area":38.98,"type":"office"},{"area":112.12,"type":"office"},{"area":19.82,"type":"office"},{"area":30.35,"type":"office"},{"area":19.6,"type":"office"},{"area":72.69,"type":"office"},{"area":52.42,"type":"office"},{"area":16.58,"type":"office"},{"area":30.24,"type":"office"},{"area":35.73,"type":"office"},{"area":18.14,"type":"office"},{"area":40.1,"type":"office"},{"area":31.58,"type":"office"},{"area":38.64,"type":"office"},{"area":52.86,"type":"office"},{"area":28.34,"type":"office"},{"area":33.04,"type":"office"},{"area":55.44,"type":"office"},{"area":33.82,"type":"office"},{"area":18.26,"type":"office"},{"area":150.1,"type":"shopping"},{"area":51.52,"type":"office"}]},"item2":{"lat":"55.785962719004","lng":"37.584969117641","index":2,"title":"\u0411\u0438\u0437\u043d\u0435\u0441-\u043f\u0430\u0440\u043a \u00ab\u041f\u0440\u0430\u0432\u0434\u0430, 24\u00bb","area":"147349","photo":"\/upload\/resize_cache\/iblock\/05e\/70_70_2\/IMG_8256.jpg","address":"\u0423\u043b\u0438\u0446\u0430 \u041f\u0440\u0430\u0432\u0434\u044b, 24 (\u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438)","href":"\/rent\/object.html?ID=10945","type":"office","blocks":[{"area":17.47,"type":"office"},{"area":15.46,"type":"office"},{"area":39.53,"type":"storage"},{"area":82.62,"type":"storage"},{"area":581.14,"type":"storage"},{"area":16.46,"type":"office"},{"area":190.4,"type":"office"},{"area":38.64,"type":"office"},{"area":16.8,"type":"office"},{"area":30.35,"type":"office"},{"area":32.25,"type":"office"},{"area":141.12,"type":"office"},{"area":877.39,"type":"storage"},{"area":67.54,"type":"free-appointment"},{"area":101.63,"type":"storage"},{"area":31.7,"type":"office"},{"area":52.27,"type":"office"},{"area":15.9,"type":"office"},{"area":74.32,"type":"office"},{"area":121,"type":"storage"},{"area":254,"type":"office"},{"area":238.2,"type":"storage"},{"area":236.33,"type":"storage"},{"area":41.15,"type":"storage"},{"area":151.31,"type":"storage"},{"area":594,"type":"storage"},{"area":82.4,"type":"storage"},{"area":177.55,"type":"storage"},{"area":33.26,"type":"free-appointment"},{"area":115.1,"type":"storage"},{"area":758.16,"type":"storage"},{"area":1,"type":"storage"},{"area":736.56,"type":"storage"}]},"item3":{"lat":"55.774129339959","lng":"37.520196452141","index":3,"title":"\u0411\u0438\u0437\u043d\u0435\u0441-\u043f\u0430\u0440\u043a \u043d\u0430 \u041c\u0430\u0433\u0438\u0441\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u0439 ","area":"28544","photo":"\/upload\/resize_cache\/iblock\/56c\/70_70_2\/a6d13105a9e3a9036670c768e588ed1d.jpg","address":"4-\u044f \u041c\u0430\u0433\u0438\u0441\u0442\u0440\u0430\u043b\u044c\u043d\u0430\u044f \u0443\u043b\u0438\u0446\u0430, 5 (\u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438)","href":"\/rent\/object.html?ID=10947","type":"office","blocks":[{"area":338.26,"type":"storage"},{"area":186.26,"type":"office"},{"area":59.25,"type":"office"},{"area":14.15,"type":"storage"},{"area":53.57,"type":"storage"},{"area":305.91,"type":"storage"},{"area":89.38,"type":"office"},{"area":138.77,"type":"office"},{"area":436.75,"type":"storage"},{"area":176.74,"type":"office"},{"area":415.11,"type":"storage"},{"area":426.49,"type":"storage"},{"area":323.34,"type":"office"},{"area":25.98,"type":"office"},{"area":184.02,"type":"office"},{"area":658.75,"type":"all"},{"area":352.02,"type":"office"}]},"item4":{"lat":"55.675981495517","lng":"37.625060095787","index":4,"title":"\u0411\u0438\u0437\u043d\u0435\u0441-\u0446\u0435\u043d\u0442\u0440 \u00ab\u0412\u0430\u0440\u0448\u0430\u0432\u0441\u043a\u0438\u0439\u00bb","area":"38391","photo":"\/upload\/resize_cache\/iblock\/f25\/70_70_2\/7bcc9921e96e63fd93cf8c2ad104ea47.jpg","address":"\u0412\u0430\u0440\u0448\u0430\u0432\u0441\u043a\u043e\u0435 \u0448\u043e\u0441\u0441\u0435, 42 (\u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438)","href":"\/rent\/object.html?ID=10951","type":"office","blocks":[{"area":33.45,"type":"office"},{"area":31.32,"type":"storage"},{"area":21.45,"type":"storage"},{"area":48.94,"type":"storage"},{"area":11.69,"type":"storage"},{"area":25.67,"type":"office"},{"area":32.66,"type":"office"},{"area":33.89,"type":"office"},{"area":40.22,"type":"office"},{"area":31.03,"type":"office"},{"area":40.41,"type":"office"},{"area":26.71,"type":"office"},{"area":198.35,"type":"office"},{"area":208.3,"type":"office"},{"area":33.09,"type":"office"},{"area":515.71,"type":"office"},{"area":376.03,"type":"office"},{"area":29.08,"type":"storage"},{"area":59.4,"type":"storage"},{"area":39.96,"type":"office"},{"area":113.49,"type":"office"},{"area":116.47,"type":"office"},{"area":70.32,"type":"shopping"}]},"item5":{"lat":"55.722488066611","lng":"37.65184463501","index":5,"title":"\u0414\u0435\u043b\u043e\u0432\u043e\u0439 \u043a\u0432\u0430\u0440\u0442\u0430\u043b \u00ab\u041d\u043e\u0432\u043e\u0441\u043f\u0430\u0441\u0441\u043a\u0438\u0439\u00bb","area":"112000","photo":"\/upload\/resize_cache\/iblock\/314\/70_70_2\/0031_2.jpg","address":"\u0414\u0435\u0440\u0431\u0435\u043d\u0435\u0432\u0441\u043a\u0430\u044f \u043d\u0430\u0431\u0435\u0440\u0435\u0436\u043d\u0430\u044f, 7 (\u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438)","href":"\/rent\/object.html?ID=10939","type":"office","blocks":[{"area":98.9,"type":"office"},{"area":949.42,"type":"office"},{"area":86.52,"type":"office"},{"area":866.32,"type":"office"},{"area":509.47,"type":"office"},{"area":24.75,"type":"office"},{"area":249.76,"type":"office"},{"area":22.6,"type":"office"},{"area":11.2,"type":"office"},{"area":18.59,"type":"office"},{"area":65,"type":"shopping"},{"area":105,"type":"shopping"},{"area":166.8,"type":"shopping"},{"area":134.4,"type":"office"},{"area":88.5,"type":"office"},{"area":447.1,"type":"office"},{"area":663.49,"type":"office"},{"area":122.94,"type":"office"},{"area":1596.12,"type":"office"},{"area":297.42,"type":"office"},{"area":380.5,"type":"office"},{"area":1401.8,"type":"office"},{"area":98.9,"type":"office"},{"area":358.4,"type":"office"}]},"item6":{"lat":"55.741650171686","lng":"37.588034882545","index":6,"title":"\u041c\u0430\u043b\u044b\u0439 \u041b\u0435\u0432\u0448\u0438\u043d\u0441\u043a\u0438\u0439, 7","area":"1848","photo":"\/upload\/resize_cache\/iblock\/8a2\/70_70_2\/01.jpg","address":"\u041c\u0430\u043b\u044b\u0439 \u041b\u0435\u0432\u0448\u0438\u043d\u0441\u043a\u0438\u0439 \u043f\u0435\u0440\u0435\u0443\u043b\u043e\u043a, 7, \u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 2, 3 (\u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438)","href":"\/rent\/object.html?ID=10936","type":"office","blocks":[{"area":328.27,"type":"office"},{"area":19.26,"type":"office"},{"area":171.81,"type":"office"},{"area":348.88,"type":"office"},{"area":112.68,"type":"office"},{"area":135.97,"type":"free-appointment"},{"area":56.56,"type":"office"},{"area":138.21,"type":"office"},{"area":25.42,"type":"office"},{"area":35.5,"type":"office"},{"area":241.92,"type":"office"}]},"item7":{"lat":"55.645012743535","lng":"37.703897953033","index":7,"title":"\u041e\u0444\u0438\u0441\u043d\u043e-\u0441\u043a\u043b\u0430\u0434\u0441\u043a\u043e\u0439 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441 \u043d\u0430 \u0414\u043e\u043d\u0435\u0446\u043a\u043e\u0439","area":"55034","photo":"\/upload\/resize_cache\/iblock\/87a\/70_70_2\/main_photo_8.png","address":"\u0414\u043e\u043d\u0435\u0446\u043a\u0430\u044f \u0443\u043b., \u0434.30 (\u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438)","href":"\/rent\/object.html?ID=11309","type":null,"blocks":[{"area":128.74,"type":"storage"},{"area":199.73,"type":"storage"},{"area":253.95,"type":"storage"},{"area":37.41,"type":"office"},{"area":14.67,"type":"office"},{"area":48.61,"type":"office"},{"area":39.09,"type":"office"},{"area":30.46,"type":"office"},{"area":789,"type":"storage"},{"area":3,"type":"storage"},{"area":2126.95,"type":"storage"},{"area":929.23,"type":"storage"},{"area":2,"type":"storage"},{"area":2142.83,"type":"storage"},{"area":1060.4,"type":"storage"},{"area":149.74,"type":"office"},{"area":933.44,"type":"storage"},{"area":918.11,"type":"storage"},{"area":918.22,"type":"storage"}]},"item8":{"lat":"55.643081536771","lng":"37.638680353165","index":8,"title":"\u041e\u0444\u0438\u0441\u043d\u043e-\u0441\u043a\u043b\u0430\u0434\u0441\u043a\u043e\u0439 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441 \u043d\u0430\u00a0\u041a\u043e\u0442\u043b\u044f\u043a\u043e\u0432\u0441\u043a\u043e\u0439","area":"27655","photo":"\/upload\/resize_cache\/iblock\/6c0\/70_70_2\/kotl1.jpg","address":"\u0443\u043b. \u041a\u043e\u0442\u043b\u044f\u043a\u043e\u0432\u0441\u043a\u0430\u044f, 6 (\u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438)","href":"\/rent\/object.html?ID=10943","type":"office","blocks":[{"area":58.54,"type":"free-appointment"},{"area":39.2,"type":"office"},{"area":53.98,"type":"office"},{"area":385.95,"type":"office"},{"area":49.84,"type":"office"},{"area":39.31,"type":"office"},{"area":11.66,"type":"office"},{"area":170.35,"type":"office"},{"area":32.93,"type":"office"},{"area":90.05,"type":"office"},{"area":198.4,"type":"shopping"}]},"item9":{"lat":"55.742489437917","lng":"37.707567214966","index":9,"title":"\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e-\u0441\u043a\u043b\u0430\u0434\u0441\u043a\u043e\u0439 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441 \u043d\u0430 \u041f\u043e\u0434\u044a\u0435\u043c\u043d\u043e\u0439 \u0443\u043b\u0438\u0446\u0435","area":"60865","photo":"\/upload\/resize_cache\/iblock\/364\/70_70_2\/7.1.jpg","address":"\u0443\u043b. \u041f\u043e\u0434\u044a\u0435\u043c\u043d\u0430\u044f, 14 (\u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438)","href":"\/rent\/object.html?ID=10938","type":"office","blocks":[{"area":39.42,"type":"storage"},{"area":21.5,"type":"office"},{"area":20.27,"type":"office"},{"area":449.28,"type":"storage"},{"area":27.1,"type":"office"},{"area":24.19,"type":"office"},{"area":11.54,"type":"office"},{"area":22.63,"type":"office"},{"area":21.73,"type":"office"},{"area":17.92,"type":"office"},{"area":147.96,"type":"storage"},{"area":42.12,"type":"storage"},{"area":165.24,"type":"storage"},{"area":32.4,"type":"storage"},{"area":21.06,"type":"office"},{"area":16.91,"type":"office"},{"area":41.44,"type":"office"},{"area":26.88,"type":"office"},{"area":22.62,"type":"office"},{"area":188.72,"type":"office"},{"area":176.06,"type":"office"},{"area":122.19,"type":"office"},{"area":450.24,"type":"office"}]},"item10":{"lat":"55.729973785763","lng":"37.736878395081","index":10,"title":"\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e-\u0441\u043a\u043b\u0430\u0434\u0441\u043a\u043e\u0439 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441 \u043d\u0430 \u0420\u044f\u0437\u0430\u043d\u0441\u043a\u043e\u043c \u043f\u0440\u043e\u0441\u043f\u0435\u043a\u0442\u0435","area":"88381","photo":"\/upload\/resize_cache\/iblock\/8e3\/70_70_2\/1.jpg","address":"\u0420\u044f\u0437\u0430\u043d\u0441\u043a\u0438\u0439 \u043f\u0440\u043e\u0441\u043f\u0435\u043a\u0442, 2 (\u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438)","href":"\/rent\/object.html?ID=11388","type":null,"blocks":[{"area":869.5,"type":"storage"},{"area":44.8,"type":"office"},{"area":26.54,"type":"office"},{"area":25.54,"type":"office"},{"area":12.88,"type":"office"},{"area":45.59,"type":"office"},{"area":16.24,"type":"office"},{"area":23.41,"type":"office"},{"area":35.5,"type":"office"},{"area":41.69,"type":"office"},{"area":80.98,"type":"office"},{"area":36.06,"type":"office"},{"area":76.61,"type":"office"},{"area":187.82,"type":"office"},{"area":73.2,"type":"storage"},{"area":46.37,"type":"office"},{"area":131.71,"type":"office"},{"area":294.22,"type":"office"},{"area":106.06,"type":"office"},{"area":144.93,"type":"office"},{"area":501.12,"type":"storage"},{"area":356.4,"type":"storage"},{"area":208.2,"type":"storage"}]},"item11":{"lat":"55.540615954637","lng":"37.559319152832","index":11,"title":"\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e-\u0441\u043a\u043b\u0430\u0434\u0441\u043a\u043e\u0439 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441 \u043d\u0430 \u0424\u0435\u043e\u0434\u043e\u0441\u0438\u0439\u0441\u043a\u043e\u0439","area":"34197","photo":"\/upload\/resize_cache\/iblock\/798\/70_70_2\/01-.jpg","address":"\u0443\u043b. \u0424\u0435\u043e\u0434\u043e\u0441\u0438\u0439\u0441\u043a\u0430\u044f, 1 (\u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438)","href":"\/rent\/object.html?ID=10866","type":"shopping","blocks":[{"area":512.3,"type":"free-appointment"},{"area":466.24,"type":"storage"},{"area":46,"type":"storage"},{"area":76.14,"type":"storage"},{"area":257.15,"type":"storage"},{"area":468.5,"type":"storage"},{"area":168.59,"type":"storage"},{"area":78.84,"type":"storage"},{"area":1173.5,"type":"storage"},{"area":24.86,"type":"office"},{"area":29.57,"type":"office"},{"area":31.81,"type":"office"},{"area":23.18,"type":"office"},{"area":64.96,"type":"storage"},{"area":23.87,"type":"storage"},{"area":100.33,"type":"storage"},{"area":20.84,"type":"storage"},{"area":91.91,"type":"storage"},{"area":75.28,"type":"storage"},{"area":400.57,"type":"storage"},{"area":74.95,"type":"storage"},{"area":409.75,"type":"storage"},{"area":76.68,"type":"storage"},{"area":430.92,"type":"storage"},{"area":172.26,"type":"storage"},{"area":177.61,"type":"storage"},{"area":937.87,"type":"storage"},{"area":10.58,"type":"storage"},{"area":10.58,"type":"storage"},{"area":55.4,"type":"storage"},{"area":9.4,"type":"storage"},{"area":37.58,"type":"storage"},{"area":73.98,"type":"storage"},{"area":38.86,"type":"office"},{"area":52.42,"type":"office"},{"area":31.92,"type":"office"},{"area":70.78,"type":"office"},{"area":24.64,"type":"office"},{"area":115.45,"type":"storage"},{"area":73.01,"type":"storage"},{"area":110.16,"type":"storage"}]}}},"st-p":{"lat":"59.958792","lng":"30.281906738281","zoom":10,"city":"st-p","items":{"item1":{"lat":"59.940506347852","lng":"30.327536478043","index":1,"title":"\u0411\u0438\u0437\u043d\u0435\u0441-\u0446\u0435\u043d\u0442\u0440 \u043d\u0430 \u041a\u043e\u043d\u044e\u0448\u0435\u043d\u043d\u043e\u0439","area":"7484","photo":"\/upload\/resize_cache\/iblock\/01f\/70_70_2\/3.1.JPG","address":"\u0411\u0438\u0437\u043d\u0435\u0441-\u0446\u0435\u043d\u0442\u0440 \u043d\u0430 \u041a\u043e\u043d\u044e\u0448\u0435\u043d\u043d\u043e\u0439","href":"\/rent\/object.html?ID=10937","type":"office","blocks":[{"area":150,"type":"office"}]},"item2":{"lat":"59.977359983504","lng":"30.31774105072","index":2,"title":"\u0422\u043e\u0440\u0433\u043e\u0432\u043e-\u043e\u0444\u0438\u0441\u043d\u044b\u0439 \u0446\u0435\u043d\u0442\u0440 \u00abRiver House\u00bb","area":"29915","photo":"\/upload\/resize_cache\/iblock\/1e8\/70_70_2\/101814d5cee1a4d47ed0b8f5fef0230a.jpg","address":"\u0422\u043e\u0440\u0433\u043e\u0432\u043e-\u043e\u0444\u0438\u0441\u043d\u044b\u0439 \u0446\u0435\u043d\u0442\u0440 \u00abRiver House\u00bb","href":"\/rent\/object.html?ID=10950","type":"office","blocks":[{"area":140.6,"type":"office"},{"area":542.4,"type":"office"},{"area":265.4,"type":"shopping"}]}}}}; }; ArendaMap.prototype = { init:function(data) { var th = this; this.mapContainerSelector = "arenda-map"; this.setLocation(this.getCookie('location') || 'moscow'); this.initMarkers(); this.mapInit(); this.markersFilterByType(this.map, this.markers); if(!this.bind) { if(this.getCookie('location')) $('UL.city>LI').removeClass('active').parent().find('.' + this.getCookie('location')).addClass('active'); if(this.getCookie('mode')) $('UL.premises>LI').removeClass('active').parent().find('.' + this.getCookie('mode')).addClass('active'); $('UL.city>LI').bind('click', $.proxy(this.scope, "changeLocation")); $('UL.premises>LI').bind('click', $.proxy(this.scope, "changeMarkerMode")); $('.map-navigation>LI').bind('click', $.proxy(this.scope, "moveMap")); setTimeout(function(){ th.markersFilterByType(th.map, th.markers); $(window).trigger('resize'); }, 1); /* $('.rent li.location-item').bind('click', function(e){ if($(this).hasClass('active')) return false; $('li.location-item').toggleClass('active'); $('div.map').toggleClass('my_hide'); $('p.use-filter').toggleClass('my_hide'); $('div.premises').toggleClass('my_hide'); th.initMarkers(); th.mapInit(); th.markersFilterByType(th.map, th.markers); $(window).trigger('resize'); return false; }); */ this.bind = true; } this.areaMaxInput = $( "#area-max" ) this.areaMinInput = $( "#area-min" ) this.filterAreaSlider.slider({ range: true, animate: true, min: this.minArea, max: this.maxArea, values: [ this.currentMinArea, this.currentMaxArea ], slide: $.proxy(this.scope, "onSliderSlide"), stop: $.proxy(this.scope, "onSliderStop") }); this.areaMinInput.val( this.currentMinArea ).bind('keyup', $.proxy(this.scope, "changeSlider")); this.areaMaxInput.val( this.currentMaxArea ).bind('keyup', $.proxy(this.scope, "changeSlider")); var text = ''; for(city in this.data){ for(Item in this.data[city].items) { text = ''; var area_arr = [], type_arr = [], i = 0, j = 0; for(y in this.data[city].items[Item].blocks) { if(this.data[city].items[Item].blocks[y].area) area_arr[i] = this.data[city].items[Item].blocks[y].area; else area_arr[i] = false; if(this.data[city].items[Item].blocks[y].type) type_arr[i] = this.data[city].items[Item].blocks[y].type; else type_arr[i] = false; i++ } text += ''; text += '

' + this.data[city].items[Item].title + ''; if(this.data[city].items[Item].area) text += ' (' + this.data[city].items[Item].area + ' м²)'; text += '

'; if(this.data[city].items[Item].address) text += '

' + this.data[city].items[Item].address + '

'; text += '
'; text = $(text); if(city != 'moscow' || (this.data[city].items[Item].area > 1000 || this.data[city].items[Item].area < 50)) text.hide(); $('div.premises .scroll-pane .my_content').append(text); } } }, changeSlider: function(e, ui) { var d = $(e.currentTarget).parent(); if(/[^\d\.]/.test(d.find('input').eq(0).val()) || /[^\d\.]/.test(d.find('input').eq(1).val())) return true; var th = this, val_Min = Number(d.find('input').eq(0).val()) * 100 / this.maxArea, val_Max = Number(d.find('input').eq(1).val()) * 100 / this.maxArea; //if(!val_Min || !val_Max) // return true; val_Min = MinOrMax(val_Min); val_Max = MinOrMax(val_Max); if(val_Min > val_Max) { val_Max = val_Min - val_Max; val_Min -= val_Max; val_Max += val_Min; } this.filterAreaSlider.find('a').eq(0).stop(true).animate({'left': val_Min + '%'}, 'fast'); this.filterAreaSlider.find('a').eq(1).stop(true).animate({'left': val_Max + '%'}, 'fast'); this.onSliderStop(); function MinOrMax(p){ return p > 100 ? 100 : (p < 0 ? 0 : p); } }, onSliderSlide:function(e, ui) { this.updateSliderToInput(e, ui); }, onSliderStop:function(e, ui) { this.setCookie('areaMin', this.currentMinArea = this.areaMinInput.val()); this.setCookie('areaMax', this.currentMaxArea = this.areaMaxInput.val()); var th = this; setTimeout(function(){ th.filterAreaSlider.slider("option", { values: [ th.currentMinArea, th.currentMaxArea ], }); }, 300); this.markersFilterByType(this.map, this.markers); }, updateSliderToInput:function(e, ui) { this.areaMinInput.val( ui.values[ 0 ] ); this.areaMaxInput.val( ui.values[ 1 ]); this.currentMinArea = this.areaMinInput.val(); this.currentMaxArea = this.areaMaxInput.val(); }, updateSliderFormInput:function(e, ui) { }, moveMap:function(e) { var direction = $(e.currentTarget); if(direction.hasClass('top')) this.map.panBy(0, this.MOVE_DIRECTION); if(direction.hasClass('left')) this.map.panBy(this.MOVE_DIRECTION, 0); if(direction.hasClass('right')) this.map.panBy(-this.MOVE_DIRECTION, 0); if(direction.hasClass('bottom')) this.map.panBy(0, -this.MOVE_DIRECTION); this.checkBounds(); return false; }, changeMarkerMode:function(e) { if($(e.currentTarget).hasClass('active')) return false; this.markerMode = $(e.currentTarget).attr('class'); this.markersFilterByType(this.map, this.markers); this.setCookie('mode', $(e.currentTarget).attr('class')); $(e.currentTarget).parent().find('li').removeClass('active'); $(e.currentTarget).addClass('active'); return false; }, changeLocation:function(e) { if($(e.currentTarget).hasClass('active')) return false; this.setLocation($(e.currentTarget).attr('class')); this.initMarkers(); this.setCookie('location', $(e.currentTarget).attr('class')); this.mapInit(); this.markersFilterByType(this.map, this.markers); $(e.currentTarget).parent().find('li').removeClass('active'); $(e.currentTarget).addClass('active'); return false; }, setLocation:function(city) { this.currentLocation = city; }, getLocation:function(city) { return this.currentLocation; }, initMarkers:function(){ this.markers = this.data[this.getLocation()].items; //console.log(this.markers); }, mapInit:function() { this.mapOptions = { zoom: this.data[this.getLocation()].zoom, minZoom: window.minZoom || 1, maxZoom: window.maxZoom || 18, disableDefaultUI: true, zoomControl: true, panControl: true, mapTypeControl: true, center: new google.maps.LatLng( this.data[this.getLocation()].lat, this.data[this.getLocation()].lng ), //disableDoubleClickZoom: true, mapTypeId: google.maps.MapTypeId.ROADMAP } this.map = new google.maps.Map(document.getElementById(this.mapContainerSelector), this.mapOptions); //this.map.scrollwheel = false; var mapBoundsSouthWest = new google.maps.LatLng( Number(this.data[this.getLocation()].mapBoundsSouth), Number(this.data[this.getLocation()].mapBoundsWest) ) var mapBoundsNorthEast = new google.maps.LatLng( Number(this.data[this.getLocation()].mapBoundsNorth), Number(this.data[this.getLocation()].mapBoundsEast) ) var mapBounds = new google.maps.LatLngBounds(mapBoundsSouthWest, mapBoundsNorthEast); var overlay = new google.maps.GroundOverlay("../i/map/"+this.data[this.getLocation()].city+".png", mapBounds); overlay.setMap(this.map); var map = this.map; function gmnoprint_c(v, t, m) { var gmnoprint = $('.gmnoprint'); if(gmnoprint.size() && gmnoprint.size() && !t && !m) return setTimeout(function(){gmnoprint_c(gmnoprint.size(), true)}, 200); if(gmnoprint.size() && gmnoprint.size() && t && !m) return setTimeout(function(){gmnoprint_c(gmnoprint.size(), true, true)}, 200); if(gmnoprint.size() && gmnoprint.size() == v & t & m) { gmnoprint.eq(-1).animate({'margin-top': '20px', 'margin-right': '24px'}, 'fast'); /* gmnoprint.eq(-2).prev().prev().css({'top':0}).hide().fadeOut(10, function(){ map.panBy(-1, 0); map.panBy(1, 0); });*/ } else setTimeout(function(){gmnoprint_c(gmnoprint.size())}, 200); }; gmnoprint_c(0); google.maps.event.addListener(this.map, "drag", $.proxy(this.scope, "checkBounds")); }, checkBounds:function (e) { var southWest = new google.maps.LatLng(Number(this.data[this.getLocation()].mapBoundsSouth_),Number(this.data[this.getLocation()].mapBoundsWest_)); var northEast = new google.maps.LatLng(Number(this.data[this.getLocation()].mapBoundsNorth_),Number(this.data[this.getLocation()].mapBoundsEast_)); var allowedBounds = new google.maps.LatLngBounds(southWest, northEast); if (allowedBounds.contains(this.map.getCenter())) { return; } var C = this.map.getCenter(); var X = C.lng(); var Y = C.lat(); var AmaxX = allowedBounds.getNorthEast().lng(); var AmaxY = allowedBounds.getNorthEast().lat(); var AminX = allowedBounds.getSouthWest().lng(); var AminY = allowedBounds.getSouthWest().lat(); var AmaxX_ = this.data[this.getLocation()].mapBoundsEast_; var AmaxY_ = this.data[this.getLocation()].mapBoundsNorth_; var AminX_ = this.data[this.getLocation()].mapBoundsWest_; var AminY_ = this.data[this.getLocation()].mapBoundsSouth_; if (X < AminX) {X = AminX_;} if (X > AmaxX) {X = AmaxX_;} if (Y < AminY) {Y = AminY_;} if (Y > AmaxY) {Y = AmaxY_;} this.map.setCenter(new google.maps.LatLng(Y,X)); }, checkAreas: function(location){ //console.log(location); var icon = ''; if(!window.filter) { if (location.type == 14) // земельные участки icon = window.src_marker_14; else if (location.type == 10) icon = window.src_marker_10; } else { var icon = window.src_marker_deactive; } if(location.blocks && location.blocks.length) for(i in location.blocks) { if(location.blocks[i].type == this.markerMode || this.markerMode == 'all') { if(!(Number(location.blocks[i].area) > this.currentMaxArea && this.currentMaxArea < this.maxArea || Number(location.blocks[i].area) < this.currentMinArea)) { icon = window.src_marker; break; } } } /* else { if(location == this.markerMode || this.markerMode == 'all') if(!(Number(location.area) > this.currentMaxArea && this.currentMaxArea < this.maxArea || Number(location.area) < this.currentMinArea)) icon = window.src_marker; } */ return icon; }, markersFilterByType:function(map, locations) { var image = new google.maps.MarkerImage(window.src_marker, new google.maps.Size(17, 16), new google.maps.Point(0,0), new google.maps.Point(0, 32)); var image_deactive = new google.maps.MarkerImage(window.src_marker, new google.maps.Size(17, 16), new google.maps.Point(0,0), new google.maps.Point(0, 32)); if (this.markersArray) { for (var i in this.markersArray) { this.markersArray[i].setMap(null); } this.markersArray.length = 0; } $(window).trigger('resize'); for(var i in locations) { var latlng = new google.maps.LatLng(locations[i].lat, locations[i].lng), icon = this.checkAreas(locations[i]); if(!icon) continue; var marker = new google.maps.Marker({ position: latlng, map: map, icon: new google.maps.MarkerImage( icon, new google.maps.Size(17, 16), new google.maps.Point(0,0), new google.maps.Point(17, 16) ), title: locations[i].title, href: locations[i].href, area: locations[i].area, photo: locations[i].photo, type: locations[i].type, zIndex: 1000, optimized: false }); //console.log(marker); this.markersArray.push(marker); google.maps.event.addListener(marker, 'click', function(e){ th.buildTooltip(th.scope, this, e); }); } var selector = 'span.my_content span.my_block.' + this.currentLocation; $('span.my_content span.my_block').hide(); // if(this.markerMode != this.markerDefaultMode) // selector += '.' + this.markerMode; var th = this; $(selector).show().each(function(){ var area = $(this).attr('area'), type = $(this).attr('type'), areas = explode(',', $(this).attr('areas')), types = explode(',', $(this).attr('types')), ok = false; for(a in areas) { if(types[a] == th.markerMode || th.markerMode == 'all') { if(areas[a] && !(Number(areas[a]) > th.currentMaxArea && th.currentMaxArea < th.maxArea || Number(areas[a]) < th.currentMinArea)) { ok =true; break; } } } if(!ok) $(this).hide(); }); }, buildTooltip: function(th, marker, e) { var map_block = $('#arenda-map div:first div:first div:first'), corn = map_block.find('#bar_corn'), bar = $('.bar_map'); if(bar.data('latLng') == e.latLng) return false; var img = bar.find('.picture .bar_img'), title = bar.find('.bar_title'), area = bar.find('.bar_area'), a = bar.find('a'); var image = new google.maps.MarkerImage( window.src_marker_active, new google.maps.Size(17, 16), new google.maps.Point(0,0), new google.maps.Point(17, 16) ); //marker.setIcon(image); marker.setZIndex(9999); $('html').bind('mousedown', function(e){ var re = new RegExp (src_marker_deactive + '$') if(e.target.nodeName == 'IMG' && !re.test(e.target.src) || e.target.src == window.src_marker || !(!(e.target.className != 'bar_img' && e.target.className == 'gmnoprint') && e.target.className != 'gmnoprint' && !/(area|bar_title|bar_area|bar_)/.test(e.target.className))) return true; /* var image = new google.maps.MarkerImage( window.src_marker, new google.maps.Size(17, 16), new google.maps.Point(0,0), new google.maps.Point(17, 16) );*/ // marker.setIcon(image); marker.setZIndex(1000); }); if(!corn.size()) { map_block.prepend(corn = bar.find('#bar_corn').clone().end().remove()); corn.css({ 'top': '0', 'left': '0', 'width': '90px', 'height': '90px', 'z-index': '2' }).hide(0); bar.removeClass('hidden') .hide() .clone() .css({ 'position': 'absolute', 'z-index': 102 }) $('body').bind('mousedown', function(e){ //th.map.getDiv() if(e.target.nodeName != 'IMG' && e.target.className != 'bar_img' && e.target.className != 'gmnoprint' && !/(area|bar_title|bar_area|bar_)/.test(e.target.className)) { corn.hide(); bar.data('latLng', 'false').fadeOut('fast'); } }); $(window).resize(function(){corn.fadeOut(100);bar.data('latLng', 'false').fadeOut('fast');}); /* $('.map-navigation>LI').bind('click', function(){ corn.hide(); bar.data('latLng', 'false').fadeOut('fast') }); */ }; corn.fadeOut(100); if(!bar.data('latLng') || bar.data('latLng') == 'false') bar.fadeIn('fast'); if(bar.data('latLng') != 'false' && bar.data('latLng') != undefined) { if(!bar.data('area')) bar.data('area', area.css('color')); if(!bar.data('title')) bar.data('title', title.css('color')); area.fadeOut(0, function() { if(marker.href) a.attr('href', marker.href); if(marker.title) title.html(marker.title.replace('&', '&')); else title.html(marker.title.replace('&', '&')); if(marker.area) area.html(marker.area); else area.html(''); if(marker.photo) img.attr('src', marker.photo).show(); else img.hide(); }); title.fadeOut(0); } else { if(marker.href) a.attr('href', marker.href); bar if(marker.title) title.html(marker.title); else title.html(marker.title); if(marker.area) area.html(marker.area); else area.html(''); if(marker.photo) img.attr('src', marker.photo).show(); else img.hide(); } if(bar.data('latLng') != 'false' && bar.data('latLng')) { area.fadeIn(0); title.fadeIn(0); } bar.data('latLng', e.latLng); var Height_ = 0; if(Height_ = $('div.map.rent.my_project').height()){ Height_ = ($('#wrapper').height() - 750)/2; Height_CSS = (($('div.map.rent.my_project').height() - 415)/4) - Height_/2; } else { Height_ = ($('#wrapper').height() - 750)/2 + 80; Height_CSS = 0; } corn.css({ 'top': (e.pixel.y + window.corn_y) + Height_CSS + 'px', 'left': (e.pixel.x - window.corn_x) + 'px' }); $('.map').find('span.icon').height($('.map').find('span.city').height()); th.map.setCenter(e.latLng, th.map.getZoom()); th.map.panBy(($('#arenda-map').width() / 2) - window.corn_x_, - window.corn_y_ - Height_ + ($('html').css('margin-top').replace('px', '')*1) + bar.height()); setTimeout(function(){ corn.fadeIn('fast'); }, 400); return false; }, // возвращает cookie если есть или undefined getCookie: function (name) { var matches = document.cookie.match(new RegExp( "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)" )) return matches ? decodeURIComponent(matches[1]) : undefined }, // уcтанавливает cookie setCookie: function (name, value, props) { props = props || {} var exp = props.expires if (typeof exp == "number" && exp) { var d = new Date() d.setTime(false) exp = props.expires = d } if(exp && exp.toUTCString) { props.expires = exp.toUTCString() } value = encodeURIComponent(value) var updatedCookie = name + "=" + value for(var propName in props){ updatedCookie += "; " + propName var propValue = props[propName] if(propValue !== true){ updatedCookie += "=" + propValue } } document.cookie = updatedCookie }, // удаляет cookie deleteCookie: function (name) { setCookie(name, null, { expires: -1 }) } } })(); $(function(){ var _aM = new ArendaMap(); _aM.init(); })