{"id":4894,"date":"2025-12-15T11:51:54","date_gmt":"2025-12-15T11:51:54","guid":{"rendered":"https:\/\/masterofcity.com\/?page_id=4894"},"modified":"2025-12-19T09:22:22","modified_gmt":"2025-12-19T09:22:22","slug":"find-a-store","status":"publish","type":"page","link":"https:\/\/masterofcity.com\/it\/find-a-store\/","title":{"rendered":"Trova un negozio"},"content":{"rendered":"<div class=\"moc-store-list-container\">\n\t\t\t<div id=\"moc_location_message\" class=\"moc-location-message\" style=\"display: none;\">\n\t\t\t\t<p>Condividete la vostra posizione per scoprire i negozi pi\u00f9 vicini e trovare il percorso migliore per raggiungere il vostro rivenditore Master of City preferito.<\/p>\n\t\t\t<\/div>\n\t\t\t<div id=\"moc_stores_list_wrapper\" class=\"moc-stores-list-wrapper\">\n\t\t\t\t<div class=\"moc-stores-loading\">\n\t\t\t\t\t<div class=\"moc-spinner\"><\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<script>\n\t\t(function() {\n\t\t\t\/\/ Wait for jQuery to be available\n\t\t\tfunction initStoreList() {\n\t\t\t\tif (typeof jQuery === 'undefined') {\n\t\t\t\t\tsetTimeout(initStoreList, 100);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tjQuery(document).ready(function($) {\n\t\t\t\t\t\/\/ Check if wrapper exists\n\t\t\t\t\tif ($('#moc_stores_list_wrapper').length === 0) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\n\t\t\tvar mapProvider = \"openstreetmap\";\n\t\t\tvar googleMapsApiKey = \"\";\n\t\t\tvar routeText = \"Route in Google Maps\";\n\t\t\tvar viewStoreText = \"View Store Details\";\n\t\t\tvar noStoresText = \"No stores found.\";\n\t\t\tvar openingHoursLabel = \"Opening Hours:\";\n\t\t\tvar noImageText = \"No image\";\n\t\t\tvar timeoutErrorText = \"Request timeout. Please refresh the page.\";\n\t\t\tvar errorLoadingText = \"Error loading stores.\";\n\t\t\tvar metroStationText = \"Metro Station\";\n\t\t\tvar userLocation = null;\n\t\t\tvar storesLoaded = false;\n\t\t\tvar locationTimeout = null;\n\t\t\tvar minimalGoogleStyles = [];\n\t\t\t\n\t\t\t\/\/ Try to get user location first (with timeout)\n\t\t\tif (navigator.geolocation) {\n\t\t\t\t\/\/ Set timeout for geolocation (1500ms - longer to allow geolocation to complete)\n\t\t\t\tlocationTimeout = setTimeout(function() {\n\t\t\t\t\t\/\/ If location not received in 1500ms, load stores without location\n\t\t\t\t\tif (!storesLoaded && !userLocation) {\n\t\t\t\t\t\tloadStoresList();\n\t\t\t\t\t}\n\t\t\t\t}, 1500);\n\t\t\t\t\n\t\t\t\tnavigator.geolocation.getCurrentPosition(\n\t\t\t\t\tfunction(position) {\n\t\t\t\t\t\t\/\/ Clear timeout since we got location\n\t\t\t\t\t\tif (locationTimeout) {\n\t\t\t\t\t\t\tclearTimeout(locationTimeout);\n\t\t\t\t\t\t\tlocationTimeout = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\/\/ Only proceed if stores haven't been loaded yet\n\t\t\t\t\t\tif (!storesLoaded) {\n\t\t\t\t\t\t\tuserLocation = {\n\t\t\t\t\t\t\t\tlat: position.coords.latitude,\n\t\t\t\t\t\t\t\tlng: position.coords.longitude\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\/\/ Load stores with location (sorted)\n\t\t\t\t\t\t\tloadStoresList();\n\t\t\t\t\t\t\t\/\/ Hide location message if shown\n\t\t\t\t\t\t\t$('#moc_location_message').fadeOut();\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tfunction(error) {\n\t\t\t\t\t\t\/\/ Clear timeout\n\t\t\t\t\t\tif (locationTimeout) {\n\t\t\t\t\t\t\tclearTimeout(locationTimeout);\n\t\t\t\t\t\t\tlocationTimeout = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\/\/ Only proceed if stores haven't been loaded yet\n\t\t\t\t\t\tif (!storesLoaded) {\n\t\t\t\t\t\t\t\/\/ User denied or error occurred\n\t\t\t\t\t\t\tuserLocation = null;\n\t\t\t\t\t\t\t\/\/ Load stores without location\n\t\t\t\t\t\t\tloadStoresList();\n\t\t\t\t\t\t\t\/\/ Show message\n\t\t\t\t\t\t\t$('#moc_location_message').fadeIn();\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttimeout: 2000,\n\t\t\t\t\t\tenableHighAccuracy: false\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t\/\/ Geolocation not supported, load stores without location\n\t\t\t\tuserLocation = null;\n\t\t\t\tloadStoresList();\n\t\t\t\t$('#moc_location_message').fadeIn();\n\t\t\t}\n\t\t\t\n\t\t\tfunction loadStoresList() {\n\t\t\t\t\/\/ Prevent multiple calls\n\t\t\t\tif (storesLoaded) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\/\/ Set a timeout to remove spinner if AJAX takes too long (10 seconds)\n\t\t\t\tvar ajaxTimeout = setTimeout(function() {\n\t\t\t\t\tif (!storesLoaded) {\n\t\t\t\t\t\t$('#moc_stores_list_wrapper .moc-stores-loading').remove();\n\t\t\t\t\t\t$('#moc_stores_list_wrapper').html('<div class=\"moc-stores-error\">' + timeoutErrorText + '<\/div>');\n\t\t\t\t\t\tstoresLoaded = true;\n\t\t\t\t\t}\n\t\t\t\t}, 10000);\n\t\t\t\t\n\t\t\t\tvar data = {\n\t\t\t\t\taction: 'get_nearest_stores',\n\t\t\t\t\tnonce: \"fa6258ec73\",\n\t\t\t\t\tlatitude: userLocation ? userLocation.lat : 0,\n\t\t\t\t\tlongitude: userLocation ? userLocation.lng : 0\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\t$.ajax({\n\t\t\t\t\turl: \"https:\\\/\\\/masterofcity.com\\\/wp-admin\\\/admin-ajax.php\",\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\tdata: data,\n\t\t\t\t\ttimeout: 8000,\n\t\t\t\t\tsuccess: function(response) {\n\t\t\t\t\t\t\/\/ Clear timeout\n\t\t\t\t\t\tclearTimeout(ajaxTimeout);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\/\/ Always remove loading spinner first\n\t\t\t\t\t\t$('#moc_stores_list_wrapper .moc-stores-loading').remove();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (response.success && response.data) {\n\t\t\t\t\t\t\trenderStoresList(response.data);\n\t\t\t\t\t\t\tstoresLoaded = true;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\/\/ Show location message if no location was provided\n\t\t\t\t\t\t\tif (!userLocation) {\n\t\t\t\t\t\t\t\t$('#moc_location_message').fadeIn();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$('#moc_stores_list_wrapper').html('<div class=\"moc-stores-error\">' + noStoresText + '<\/div>');\n\t\t\t\t\t\t\tstoresLoaded = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\terror: function(xhr, status, error) {\n\t\t\t\t\t\t\/\/ Clear timeout\n\t\t\t\t\t\tclearTimeout(ajaxTimeout);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\/\/ Always remove loading spinner on error\n\t\t\t\t\t\t$('#moc_stores_list_wrapper .moc-stores-loading').remove();\n\t\t\t\t\t\t$('#moc_stores_list_wrapper').html('<div class=\"moc-stores-error\">' + errorLoadingText + '<\/div>');\n\t\t\t\t\t\tstoresLoaded = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\tfunction renderStoresList(stores) {\n\t\t\t\t\/\/ Check if wrapper element exists\n\t\t\t\tvar wrapper = $('#moc_stores_list_wrapper');\n\t\t\t\tif (wrapper.length === 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\/\/ Remove loading spinner immediately\n\t\t\t\twrapper.find('.moc-stores-loading').remove();\n\t\t\t\t\n\t\t\t\tvar html = '';\n\t\t\t\t\n\t\t\t\tif (stores.length === 0) {\n\t\t\t\t\thtml = '<div class=\"moc-stores-empty\">' + noStoresText + '<\/div>';\n\t\t\t\t} else {\n\t\t\t\t\tstores.forEach(function(store, index) {\n\t\t\t\t\t\tvar fullAddress = [store.address, store.city, store.postal_code, store.country].filter(Boolean).join(', ');\n\t\t\t\t\t\tvar distanceText = store.distance !== null ? '<span class=\"moc-store-distance\">' + store.distance + ' km<\/span>' : '';\n\t\t\t\t\t\tvar thumbnail = store.thumbnail_full || store.thumbnail || '';\n\t\t\t\t\t\t\/\/ Escape HTML\n\t\t\t\t\t\tfunction escapeHtml(text) {\n\t\t\t\t\t\t\tif (!text) return '';\n\t\t\t\t\t\t\tvar map = {\n\t\t\t\t\t\t\t\t'&': '&amp;',\n\t\t\t\t\t\t\t\t'<': '&lt;',\n\t\t\t\t\t\t\t\t'>': '&gt;',\n\t\t\t\t\t\t\t\t'\"': '&quot;',\n\t\t\t\t\t\t\t\t\"'\": '&#039;'\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\treturn text.replace(\/[&<>\"']\/g, function(m) { return map[m]; });\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar storeTitle = escapeHtml(store.title);\n\t\t\t\t\t\tvar storeAddress = escapeHtml(fullAddress);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\/\/ LCP optimization: first image should be eager with high priority\n\t\t\t\t\t\tvar isFirstImage = (index === 0);\n\t\t\t\t\t\tvar loadingAttr = isFirstImage ? 'loading=\"eager\"' : 'loading=\"lazy\"';\n\t\t\t\t\t\tvar fetchPriorityAttr = isFirstImage ? 'fetchpriority=\"high\"' : '';\n\t\t\t\t\t\t\n\t\t\t\t\t\thtml += '<div class=\"moc-store-card\" data-store-id=\"' + store.id + '\">';\n\t\t\t\t\t\thtml += '<div class=\"moc-store-header\">';\n\t\t\t\t\t\thtml += '<div class=\"moc-store-title-wrapper\">';\n\t\t\t\t\t\tif (store.url) {\n\t\t\t\t\t\t\thtml += '<h3 class=\"moc-store-title\"><a href=\"' + escapeHtml(store.url) + '\" class=\"moc-store-title-link\">' + storeTitle + '<\/a> ' + distanceText + '<\/h3>';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\thtml += '<h3 class=\"moc-store-title\">' + storeTitle + ' ' + distanceText + '<\/h3>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\thtml += '<div class=\"moc-store-address\">' + storeAddress + '<\/div>';\n\t\t\t\t\t\thtml += '<\/div>';\n\t\t\t\t\t\t\n\t\t\t\t\t\t\/\/ Opening hours (display on the right side of store name)\n\t\t\t\t\t\tif (store.opening_hours) {\n\t\t\t\t\t\t\tvar openingHoursText = escapeHtml(store.opening_hours);\n\t\t\t\t\t\t\thtml += '<div class=\"moc-store-opening-hours-header\">';\n\t\t\t\t\t\t\thtml += '<strong class=\"moc-store-opening-hours-label\">' + openingHoursLabel + '<\/strong>';\n\t\t\t\t\t\t\thtml += '<p class=\"moc-store-opening-hours-text\">' + openingHoursText.replace(\/\\n\/g, '<br>') + '<\/p>';\n\t\t\t\t\t\t\thtml += '<\/div>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\thtml += '<\/div>';\n\t\t\t\t\t\t\n\t\t\t\t\t\thtml += '<div class=\"moc-store-media\">';\n\t\t\t\t\t\thtml += '<div class=\"moc-store-image-wrapper\">';\n\t\t\t\t\t\tif (thumbnail) {\n\t\t\t\t\t\t\tvar srcset = '';\n\t\t\t\t\t\t\tif (store.thumbnail_full && store.thumbnail_full !== thumbnail) {\n\t\t\t\t\t\t\t\tsrcset = ' srcset=\"' + store.thumbnail + ' 1024w, ' + store.thumbnail_full + ' 2048w\" sizes=\"(max-width: 1024px) 1024px, 2048px\"';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar fetchPriorityFinal = fetchPriorityAttr ? fetchPriorityAttr : 'fetchpriority=\"low\"';\n\t\t\t\t\t\t\thtml += '<img src=\"' + thumbnail + '\"' + srcset + ' alt=\"' + storeTitle + '\" class=\"moc-store-image\" ' + loadingAttr + ' ' + fetchPriorityFinal + ' decoding=\"async\" \/>';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\thtml += '<div class=\"moc-store-image-placeholder\">' + noImageText + '<\/div>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\thtml += '<\/div>';\n\t\t\t\t\t\thtml += '<div class=\"moc-store-map-wrapper\" id=\"moc_store_map_' + store.id + '\"><\/div>';\n\t\t\t\t\t\thtml += '<\/div>';\n\t\t\t\t\t\t\n\t\t\t\t\t\t\/\/ Landmark information and actions wrapper\n\t\t\t\t\t\thtml += '<div class=\"moc-store-landmark-actions-wrapper\">';\n\t\t\t\t\t\t\n\t\t\t\t\t\t\/\/ Landmark information (always displayed)\n\t\t\t\t\t\thtml += '<div class=\"moc-store-landmark-wrapper\">';\n\t\t\t\t\t\thtml += '<div class=\"moc-store-landmark\">';\n\t\t\t\t\t\t\n\t\t\t\t\t\t\/\/ Determine image, walk time, and landmark name\n\t\t\t\t\t\tvar landmarkImage = '';\n\t\t\t\t\t\tvar walkTimeText = '0';\n\t\t\t\t\t\tvar landmarkName = storeTitle; \/\/ Default to store name\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (store.walk_time && store.nearest_landmark) {\n\t\t\t\t\t\t\twalkTimeText = escapeHtml(store.walk_time);\n\t\t\t\t\t\t\tlandmarkName = escapeHtml(store.nearest_landmark);\n\t\t\t\t\t\t\tif (store.landmark_image) {\n\t\t\t\t\t\t\t\tlandmarkImage = store.landmark_image;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\/\/ If no landmark image, use store thumbnail\n\t\t\t\t\t\tif (!landmarkImage && thumbnail) {\n\t\t\t\t\t\t\tlandmarkImage = thumbnail;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\/\/ Display image\n\t\t\t\t\t\tif (landmarkImage) {\n\t\t\t\t\t\t\thtml += '<div class=\"moc-store-landmark-image-wrapper\">';\n\t\t\t\t\t\t\thtml += '<img src=\"' + landmarkImage + '\" alt=\"' + landmarkName + '\" class=\"moc-store-landmark-image\" loading=\"lazy\" decoding=\"async\" fetchpriority=\"low\" \/>';\n\t\t\t\t\t\t\thtml += '<\/div>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\thtml += '<div class=\"moc-store-landmark-info\">';\n\t\t\t\t\t\thtml += '<p class=\"moc-store-walk-time\">a ' + walkTimeText + ' - minute walk from<\/p>';\n\t\t\t\t\t\thtml += '<p class=\"moc-store-landmark-name\">' + landmarkName + '<\/p>';\n\t\t\t\t\t\thtml += '<\/div>';\n\t\t\t\t\t\thtml += '<\/div>';\n\t\t\t\t\t\thtml += '<\/div>';\n\t\t\t\t\t\t\n\t\t\t\t\t\thtml += '<div class=\"moc-store-actions\">';\n\t\t\t\t\t\tif (store.url) {\n\t\t\t\t\t\t\thtml += '<a href=\"' + escapeHtml(store.url) + '\" class=\"button moc-btn-view-store\">' + viewStoreText + '<\/a>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\thtml += '<\/div>';\n\t\t\t\t\t\thtml += '<\/div>';\n\t\t\t\t\t\thtml += '<\/div>';\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\/\/ Update wrapper with generated HTML\n\t\t\t\twrapper.html(html);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\/\/ Initialize maps for each store (use pre-fetched metro stations data if available)\n\t\t\t\tif (mapProvider === 'google' && googleMapsApiKey) {\n\t\t\t\t\tstores.forEach(function(store) {\n\t\t\t\t\t\tinitGoogleMap(store.id, store.latitude, store.longitude, store.metro_stations);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tstores.forEach(function(store) {\n\t\t\t\t\t\tinitLeafletMap(store.id, store.latitude, store.longitude, store.metro_stations);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tvar mapInitAttempts = {};\n\t\t\t\n\t\t\tfunction initGoogleMap(storeId, lat, lng, metroStations) {\n\t\t\t\tvar mapElement = document.getElementById('moc_store_map_' + storeId);\n\t\t\t\tif (!mapElement) return;\n\t\t\t\t\n\t\t\t\tif (typeof google === 'undefined' || typeof google.maps === 'undefined') {\n\t\t\t\t\t\/\/ Wait for Google Maps to load (max 50 attempts = 5 seconds)\n\t\t\t\t\tif (!mapInitAttempts[storeId]) {\n\t\t\t\t\t\tmapInitAttempts[storeId] = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif (mapInitAttempts[storeId] < 50) {\n\t\t\t\t\t\tmapInitAttempts[storeId]++;\n\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\tinitGoogleMap(storeId, lat, lng);\n\t\t\t\t\t\t}, 100);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tvar map = new google.maps.Map(mapElement, {\n\t\t\t\t\t\tcenter: { lat: lat, lng: lng },\n\t\t\t\t\t\tzoom: 15,\n\t\t\t\t\t\tdisableDefaultUI: true,\n\t\t\t\t\t\tzoomControl: false,\n\t\t\t\t\t\tmapTypeControl: false,\n\t\t\t\t\t\tstreetViewControl: false,\n\t\t\t\t\t\tfullscreenControl: false,\n\t\t\t\t\t\tstyles: minimalGoogleStyles\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t\/\/ Red marker icon for store\n\t\t\t\t\tvar redMarkerIcon = {\n\t\t\t\t\t\tpath: google.maps.SymbolPath.CIRCLE,\n\t\t\t\t\t\tfillColor: '#dc3545',\n\t\t\t\t\t\tfillOpacity: 1,\n\t\t\t\t\t\tstrokeColor: '#ffffff',\n\t\t\t\t\t\tstrokeWeight: 2,\n\t\t\t\t\t\tscale: 10\n\t\t\t\t\t};\n\t\t\t\t\t\n\t\t\t\t\tnew google.maps.Marker({\n\t\t\t\t\t\tposition: { lat: lat, lng: lng },\n\t\t\t\t\t\tmap: map,\n\t\t\t\t\t\ticon: redMarkerIcon\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t\/\/ Render cached metro stations if available\n\t\t\t\t\trenderMetroStationsGoogle(map, metroStations);\n\t\t\t\t} catch(e) {\n\t\t\t\t\tconsole.error('Error initializing Google Map:', e);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfunction initLeafletMap(storeId, lat, lng, metroStations) {\n\t\t\t\tvar mapElement = document.getElementById('moc_store_map_' + storeId);\n\t\t\t\tif (!mapElement) return;\n\t\t\t\t\n\t\t\t\tif (typeof L === 'undefined') {\n\t\t\t\t\t\/\/ Wait for Leaflet to load (max 50 attempts = 5 seconds)\n\t\t\t\t\tif (!mapInitAttempts[storeId]) {\n\t\t\t\t\t\tmapInitAttempts[storeId] = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif (mapInitAttempts[storeId] < 50) {\n\t\t\t\t\t\tmapInitAttempts[storeId]++;\n\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\tinitLeafletMap(storeId, lat, lng);\n\t\t\t\t\t\t}, 100);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tvar map = L.map('moc_store_map_' + storeId, {\n\t\t\t\t\t\tzoomControl: false\n\t\t\t\t\t}).setView([lat, lng], 15);\n\t\t\t\t\t\n\t\t\t\t\tvar baseTiles = L.tileLayer('https:\/\/{s}.basemaps.cartocdn.com\/rastertiles\/voyager_nolabels\/{z}\/{x}\/{y}{r}.png', {\n\t\t\t\t\t\tattribution: '\u00a9 OpenStreetMap contributors \u00a9 CARTO',\n\t\t\t\t\t\tsubdomains: 'abcd'\n\t\t\t\t\t});\n\t\t\t\t\tvar labelTiles = L.tileLayer('https:\/\/{s}.basemaps.cartocdn.com\/rastertiles\/voyager_only_labels\/{z}\/{x}\/{y}{r}.png', {\n\t\t\t\t\t\tattribution: '',\n\t\t\t\t\t\tsubdomains: 'abcd'\n\t\t\t\t\t});\n\t\t\t\t\tbaseTiles.addTo(map);\n\t\t\t\t\tlabelTiles.addTo(map);\n\t\t\t\t\t\n\t\t\t\t\t\/\/ Red marker icon for store\n\t\t\t\t\tvar redIcon = L.icon({\n\t\t\t\t\t\ticonUrl: 'https:\/\/raw.githubusercontent.com\/pointhi\/leaflet-color-markers\/master\/img\/marker-icon-red.png',\n\t\t\t\t\t\ticonSize: [25, 41],\n\t\t\t\t\t\ticonAnchor: [12, 41],\n\t\t\t\t\t\tpopupAnchor: [1, -34]\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tL.marker([lat, lng], {icon: redIcon}).addTo(map);\n\t\t\t\t\t\n\t\t\t\t\t\/\/ Render cached metro stations if available\n\t\t\t\t\trenderMetroStationsLeaflet(map, metroStations);\n\t\t\t\t} catch(e) {\n\t\t\t\t\tconsole.error('Error initializing Leaflet Map:', e);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfunction renderMetroStationsGoogle(map, metroStations) {\n\t\t\t\tif (!metroStations || !Array.isArray(metroStations)) return;\n\t\t\t\t\n\t\t\t\tvar metroIconSVG = {\n\t\t\t\t\turl: 'data:image\/svg+xml;charset=UTF-8,' + encodeURIComponent('<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"30\" height=\"40\" viewBox=\"0 0 30 40\"><path d=\"M15,0 C6.716,0 0,6.716 0,15 C0,26.25 15,40 15,40 C15,40 30,26.25 30,15 C30,6.716 23.284,0 15,0 Z\" fill=\"#0066cc\" stroke=\"#ffffff\" stroke-width=\"1.5\"\/><text x=\"15\" y=\"22\" font-family=\"Arial, sans-serif\" font-size=\"14\" font-weight=\"bold\" fill=\"#ffffff\" text-anchor=\"middle\">M<\/text><\/svg>'),\n\t\t\t\t\tscaledSize: new google.maps.Size(30, 40),\n\t\t\t\t\tanchor: new google.maps.Point(15, 40)\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\tmetroStations.forEach(function(station) {\n\t\t\t\t\tif (!station || !station.lat || !station.lng) return;\n\t\t\t\t\t\n\t\t\t\t\tvar stationName = station.name || metroStationText;\n\t\t\t\t\t\n\t\t\t\t\tvar metroMarker = new google.maps.Marker({\n\t\t\t\t\t\tposition: { lat: station.lat, lng: station.lng },\n\t\t\t\t\t\tmap: map,\n\t\t\t\t\t\ticon: metroIconSVG,\n\t\t\t\t\t\ttitle: stationName\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tvar infoWindow = new google.maps.InfoWindow({\n\t\t\t\t\t\tcontent: '<div style=\"padding: 5px;\"><strong>' + stationName + '<\/strong><\/div>'\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tmetroMarker.addListener('click', function() {\n\t\t\t\t\t\tinfoWindow.open(map, metroMarker);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\tfunction renderMetroStationsLeaflet(map, metroStations) {\n\t\t\t\tif (!metroStations || !Array.isArray(metroStations)) return;\n\t\t\t\t\n\t\t\t\tvar metroIconSVG = '<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"30\" height=\"40\" viewBox=\"0 0 30 40\"><path d=\"M15,0 C6.716,0 0,6.716 0,15 C0,26.25 15,40 15,40 C15,40 30,26.25 30,15 C30,6.716 23.284,0 15,0 Z\" fill=\"#0066cc\" stroke=\"#ffffff\" stroke-width=\"1.5\"\/><text x=\"15\" y=\"22\" font-family=\"Arial, sans-serif\" font-size=\"14\" font-weight=\"bold\" fill=\"#ffffff\" text-anchor=\"middle\">M<\/text><\/svg>';\n\t\t\t\tvar metroIconUrl = 'data:image\/svg+xml;base64,' + btoa(metroIconSVG);\n\t\t\t\t\n\t\t\t\tvar metroIcon = L.icon({\n\t\t\t\t\ticonUrl: metroIconUrl,\n\t\t\t\t\ticonSize: [30, 40],\n\t\t\t\t\ticonAnchor: [15, 40],\n\t\t\t\t\tpopupAnchor: [0, -40]\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tmetroStations.forEach(function(station) {\n\t\t\t\t\tif (!station || !station.lat || !station.lng) return;\n\t\t\t\t\tvar stationName = station.name || metroStationText;\n\t\t\t\t\t\n\t\t\t\t\tL.marker([station.lat, station.lng], {icon: metroIcon})\n\t\t\t\t\t\t.addTo(map)\n\t\t\t\t\t\t.bindPopup('<strong>' + stationName + '<\/strong>');\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\t\/\/ Calculate distance between two coordinates (Haversine formula)\n\t\t\tfunction calculateDistance(lat1, lon1, lat2, lon2) {\n\t\t\t\tvar R = 6371000; \/\/ Earth radius in meters\n\t\t\t\tvar dLat = (lat2 - lat1) * Math.PI \/ 180;\n\t\t\t\tvar dLon = (lon2 - lon1) * Math.PI \/ 180;\n\t\t\t\tvar a = Math.sin(dLat\/2) * Math.sin(dLat\/2) +\n\t\t\t\t\tMath.cos(lat1 * Math.PI \/ 180) * Math.cos(lat2 * Math.PI \/ 180) *\n\t\t\t\t\tMath.sin(dLon\/2) * Math.sin(dLon\/2);\n\t\t\t\tvar c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\n\t\t\t\treturn R * c;\n\t\t\t}\n\t\t\t\t}); \/\/ End jQuery(document).ready\n\t\t\t} \/\/ End initStoreList\n\t\t\t\n\t\t\t\/\/ Start initialization\n\t\t\tinitStoreList();\n\t\t})();\n\t\t<\/script>\n\t\t\n\n\n\t\t<div class=\"moc-store-locator-container\">\n\t\t\t<div class=\"moc-store-locator-controls\">\n\t\t\t\t<button id=\"moc_get_location\" class=\"button moc-btn-location\">\n\t\t\t\t\tTrova i negozi pi\u00f9 vicini\t\t\t\t<\/button>\n\t\t\t\t<div id=\"moc_location_status\" class=\"moc-location-status\"><\/div>\n\t\t\t<\/div>\n\t\t\t<div id=\"moc_store_map\" style=\"height: 600px; width: 100%;\"><\/div>\n\t\t\t<div id=\"moc_store_list\" class=\"moc-store-list\"><\/div>\n\t\t<\/div>\n\t\t\n\n\n\n<p><\/p>","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-4894","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Master of City Find a Store<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/masterofcity.com\/it\/find-a-store\/\" \/>\n<meta property=\"og:locale\" content=\"it_IT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Master of City Find a Store\" \/>\n<meta property=\"og:url\" content=\"https:\/\/masterofcity.com\/it\/find-a-store\/\" \/>\n<meta property=\"og:site_name\" content=\"Master of City\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-19T09:22:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/masterofcity.com\/wp-content\/uploads\/2024\/12\/Group-382-scaled.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1674\" \/>\n\t<meta property=\"og:image:height\" content=\"2560\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Tempo di lettura stimato\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minuto\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/masterofcity.com\/find-a-store\/\",\"url\":\"https:\/\/masterofcity.com\/find-a-store\/\",\"name\":\"Master of City Find a Store\",\"isPartOf\":{\"@id\":\"https:\/\/masterofcity.com\/#website\"},\"datePublished\":\"2025-12-15T11:51:54+00:00\",\"dateModified\":\"2025-12-19T09:22:22+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/masterofcity.com\/find-a-store\/#breadcrumb\"},\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/masterofcity.com\/find-a-store\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/masterofcity.com\/find-a-store\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/masterofcity.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Find a Store\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/masterofcity.com\/#website\",\"url\":\"https:\/\/masterofcity.com\/\",\"name\":\"Master of City\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/masterofcity.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/masterofcity.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"it-IT\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/masterofcity.com\/#organization\",\"name\":\"Master of City\",\"url\":\"https:\/\/masterofcity.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\/\/masterofcity.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/masterofcity.com\/wp-content\/uploads\/2023\/07\/puste-1.jpg\",\"contentUrl\":\"https:\/\/masterofcity.com\/wp-content\/uploads\/2023\/07\/puste-1.jpg\",\"width\":1622,\"height\":526,\"caption\":\"Master of City\"},\"image\":{\"@id\":\"https:\/\/masterofcity.com\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Master of City Find a Store","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/masterofcity.com\/it\/find-a-store\/","og_locale":"it_IT","og_type":"article","og_title":"Master of City Find a Store","og_url":"https:\/\/masterofcity.com\/it\/find-a-store\/","og_site_name":"Master of City","article_modified_time":"2025-12-19T09:22:22+00:00","og_image":[{"width":1674,"height":2560,"url":"https:\/\/masterofcity.com\/wp-content\/uploads\/2024\/12\/Group-382-scaled.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Tempo di lettura stimato":"1 minuto"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/masterofcity.com\/find-a-store\/","url":"https:\/\/masterofcity.com\/find-a-store\/","name":"Master of City Find a Store","isPartOf":{"@id":"https:\/\/masterofcity.com\/#website"},"datePublished":"2025-12-15T11:51:54+00:00","dateModified":"2025-12-19T09:22:22+00:00","breadcrumb":{"@id":"https:\/\/masterofcity.com\/find-a-store\/#breadcrumb"},"inLanguage":"it-IT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/masterofcity.com\/find-a-store\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/masterofcity.com\/find-a-store\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/masterofcity.com\/"},{"@type":"ListItem","position":2,"name":"Find a Store"}]},{"@type":"WebSite","@id":"https:\/\/masterofcity.com\/#website","url":"https:\/\/masterofcity.com\/","name":"Master of City","description":"","publisher":{"@id":"https:\/\/masterofcity.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/masterofcity.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"it-IT"},{"@type":"Organization","@id":"https:\/\/masterofcity.com\/#organization","name":"Master of City","url":"https:\/\/masterofcity.com\/","logo":{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/masterofcity.com\/#\/schema\/logo\/image\/","url":"https:\/\/masterofcity.com\/wp-content\/uploads\/2023\/07\/puste-1.jpg","contentUrl":"https:\/\/masterofcity.com\/wp-content\/uploads\/2023\/07\/puste-1.jpg","width":1622,"height":526,"caption":"Master of City"},"image":{"@id":"https:\/\/masterofcity.com\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/masterofcity.com\/it\/wp-json\/wp\/v2\/pages\/4894","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/masterofcity.com\/it\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/masterofcity.com\/it\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/masterofcity.com\/it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/masterofcity.com\/it\/wp-json\/wp\/v2\/comments?post=4894"}],"version-history":[{"count":4,"href":"https:\/\/masterofcity.com\/it\/wp-json\/wp\/v2\/pages\/4894\/revisions"}],"predecessor-version":[{"id":4939,"href":"https:\/\/masterofcity.com\/it\/wp-json\/wp\/v2\/pages\/4894\/revisions\/4939"}],"wp:attachment":[{"href":"https:\/\/masterofcity.com\/it\/wp-json\/wp\/v2\/media?parent=4894"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}