Powierzchnie biurowe (1)

'; itemsSidebar.appendChild(closeButton); container.appendChild(itemsSidebar); } function openSidebar(content) { if (!itemsSidebar) { return; } const list = itemsSidebar.querySelector(".lch-map__sidebar-list"); if (list) { list.innerHTML = content; itemsSidebar.classList.add("active"); // itemsSidebar.style.right = "0"; } } function closeSidebar() { // itemsSidebar.style.right = '-300px'; itemsSidebar.classList.remove("active"); } map.fitBounds(bounds); const renderer = { render({ count, position }) { return new google.maps.Marker({ label: { text: String(count), color: "#b3181b", fontSize: "22px", className: 'marker-cluster' }, position, icon: "https://www.axiimmo.com/wp-content/themes/axi-immo/src/mapa/marker_cluster.svg", // adjust zIndex to be above other markers zIndex: Number(google.maps.Marker.MAX_ZINDEX) + count, }) } } // Add a marker clusterer to manage the markers. new markerClusterer.MarkerClusterer({ markers, map, renderer, /* minimumClusterSize: 2, algorithm: new markerClusterer.SuperClusterAlgorithm({ maxZoom: 15, radius: 60 }), */ onClusterClick: (event, cluster, map) => { const markersInCluster = cluster.markers; // create a list of elements from available data let listContent = ''; openSidebar(listContent); } }); buildSidebar(); /* map.addListener('error', function(e) { console.error('Błąd mapy:', e); }); */ google.maps.event.addListener(drawingManager, 'overlaycomplete', function (e) { if (currentShape) { currentShape.setMap(null) } currentShape = e.overlay if (e.type === google.maps.drawing.OverlayType.RECTANGLE) { // Switch back to non-drawing mode after drawing a shape. drawingManager.setDrawingMode(null); const bounds = e.overlay.getBounds() // const ne = bounds.getNorthEast() // const sw = bounds.getSouthWest() // const center = bounds.getCenter() const objBounds = bounds.toJSON() // const tostring = bounds.toString() const offer_type = "biura"; const transaction_type_query = ""; const rectangleVertex = [ [ objBounds.south, objBounds.west ], [ objBounds.north, objBounds.east ] ] const queryString = JSON.stringify(rectangleVertex) langPrefix = (document.querySelector('html').getAttribute('lang') == 'pl-PL') ? '' : 'en/'; window.location.href = '/' + langPrefix + '?s=&post_type=' + offer_type + transaction_type_query + '&show_map=1&map_zoom=' + map.getZoom() + '&map_center_lat=' + map.getCenter().lat() + '&map_center_lng=' + map.getCenter().lng() + '&map_points=' + queryString; // zapytanie do mikro serwisu o id ofert } /** * if other shapes needed */ // if (e.type === google.maps.drawing.OverlayType.CIRCLE) { // // Switch back to non-drawing mode after drawing a shape. // drawingManager.setDrawingMode(null); // const lat = e.overlay.getCenter().lat() // const lng = e.overlay.getCenter().lng() // const radius = e.overlay.getRadius() // console.log(lat, lng, radius); // } // if (e.type === google.maps.drawing.OverlayType.POLYGON) { // // Switch back to non-drawing mode after drawing a shape. // drawingManager.setDrawingMode(null); // const path = e.overlay.getPath().getArray() // const coords = path.map(a => [a.lat(), a.lng()]) // console.log(coords); // } }); } window.initMap = initMap;

Najczęściej wyszukiwane frazy