{"id":2187,"date":"2024-10-31T19:19:06","date_gmt":"2024-10-31T19:19:06","guid":{"rendered":"https:\/\/1cleanair.ca\/find-a-location-near-you\/"},"modified":"2025-01-06T20:01:07","modified_gmt":"2025-01-06T20:01:07","slug":"trouver-un-emplacement","status":"publish","type":"page","link":"https:\/\/1cleanair.ca\/fr\/trouver-un-emplacement\/","title":{"rendered":"Trouver un emplacement"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row type=&#8221;in_grid&#8221; text_align=&#8221;inherit&#8221; el_class=&#8221;padding-100&#8243;][vc_column][vc_row_inner type=&#8221;full_width&#8221; text_align=&#8221;inherit&#8221;][vc_column_inner]<div class=\"dist-shortcode-container wpb_content_element\">\n        <div class=\"franchise_search\">\n            <div class=\"franchise_search_bar_group\">\n                <div class=\"franchise_search_title\">\n                    <h1>Trouvez un emplacement<\/h1>\n                <\/div>\n                <div class=\"franchise_search_bar  \">\n                    <div class=\"franchise_search_box\">\n                        <a href=\"\" class=\"get_location_btn\" id=\"get_location_btn_ajax\" title=\"Utiliser mon emplacement\"><i class=\"fas fa-map-marker-alt\"><\/i><\/a>\n\n                        \n                        <input\n                            id=\"prosomo_franchise_pac-input\"\n                            name=\"prosomo_franchise_pac-input\"\n                            type=\"text\"\n                            placeholder=\"Recherche par ville ou par code postal\/Zip\"\n                            value=\"\"\n                        >\n                        <input\n                            id=\"prosomo_franchise_gmlat\"\n                            name=\"prosomo_franchise_gmlat\"\n                            type=\"hidden\"\n                            value=\"\"\n                        >\n                        <input\n                            id=\"prosomo_franchise_gmlng\"\n                            name=\"prosomo_franchise_gmlng\"\n                            type=\"hidden\"\n                            value=\"\"\n                        >\n\n                                            <\/div>\n\n                    <script>\n                        if (navigator.geolocation) {\n                            navigator.geolocation.getCurrentPosition(function (e) {\n                                \/\/ Permission granted\n                                jQuery(\"#get_location_btn\").click();\n                            }, function (e) {\n                                \/\/ Permission denied\n                            });\n                        }\n                        jQuery( \"#get_location_btn, #get_location_btn_ajax\" ).click(function( event ) {\n                            event.preventDefault();\n\n                            if (navigator.geolocation) {\n                                navigator.geolocation.getCurrentPosition(function (position) {\n                                    var geocoder = new google.maps.Geocoder();\n                                    geocoder.geocode({ location: { lat: parseFloat(position.coords.latitude), lng: parseFloat(position.coords.longitude) } }, (results, status) => {\n                                        if (status === \"OK\") {\n                                            if (results[0]) {\n                                                jQuery( \"#prosomo_franchise_gmlat\" ).val(position.coords.latitude);\n                                                jQuery( \"#prosomo_franchise_gmlng\" ).val(position.coords.longitude);\n                                                jQuery( \"#prosomo_franchise_pac-input\" ).val(results[0].formatted_address).trigger(\"change\");\n\n                                                if(jQuery('#map').length && jQuery('#result').length){\n\n                                                    jQuery.ajax({\n                                                        type: \"GET\",\n                                                        url : myAjax.ajaxurl,\n                                                        data : { action: \"prosomo_franchise_draw_map\", lat: position.coords.latitude, lng: position.coords.longitude },\n                                                        dataType: \"json\",\n                                                        success: function(result) {\n                                                            var myData = JSON.parse(result.data);\n\n                                                            jQuery(\"#result\").html(myData.formatted_data);\n                                                            prosomo_franchise_initMap( myData.markers_primary, myData.markers_secondary, myData.infoWindowContent_primary, myData.infoWindowContent_secondary );\n                                                        },\n                                                        error: function(XMLHttpRequest, textStatus, errorThrown) {\n                                                            alert(\"Status: \" + textStatus); alert(\"Error: \" + errorThrown);\n                                                        }\n                                                    });\n                                                }\n                                            }\n                                        }\n                                    });\n                                }, function (e) {\n                                }, {\n                                    enableHighAccuracy: true\n                                });\n                            }\n\n                        });\n\n                        \/\/ Not used anymore?\n                        function showPosition_simple(position) {\n\n                            if(!position) {\n                                console.warn(\"getCurrentPosition not set\", position);\n                                return;\n                            }\n\n                            var geocoder = new google.maps.Geocoder();\n                            geocoder.geocode({ location: { lat: parseFloat(position.coords.latitude), lng: parseFloat(position.coords.longitude) } }, (results, status) => {\n                                if (status === \"OK\") {\n                                    if (results[0]) {\n                                        jQuery( \"#prosomo_franchise_gmlat\" ).val(position.coords.latitude);\n                                        jQuery( \"#prosomo_franchise_gmlng\" ).val(position.coords.longitude);\n                                        jQuery( \"#prosomo_franchise_pac-input\" ).val(results[0].formatted_address);\n                                    }\n                                }\n                            });\n\n                            jQuery.ajax({\n                                type: \"GET\",\n                                url : myAjax.ajaxurl,\n                                data : { action: \"prosomo_franchise_draw_map\", lat: position.coords.latitude, lng: position.coords.longitude },\n                                dataType: \"json\",\n                                success: function(result) {\n                                    var myData = JSON.parse(result.data);\n\n                                    jQuery(\"#result\").html(myData.formatted_data);\n                                    prosomo_franchise_initMap( myData.markers_primary, myData.markers_secondary, myData.infoWindowContent_primary, myData.infoWindowContent_secondary );\n                                },\n                                error: function(XMLHttpRequest, textStatus, errorThrown) {\n                                    alert(\"Status: \" + textStatus); alert(\"Error: \" + errorThrown);\n                                }\n                            });\n                        }\n\n                        \/\/ Not used anymore?\n                        function showPosition_simple_ajax(position) {\n                            showPosition_simple(position);\n                        }\n\n                    <\/script>\n\n                    <div id=\"hidden_map\" style=\"display: none;\"><\/div>\n\n                    <script>\n                        function getLatLong() {\n\n                            var map = new google.maps.Map(document.getElementById(\"hidden_map\"), {\n                                center: {\n                                    lat: 48.987372,\n                                    lng: -95.341702\n                                },\n                                zoom: 4\n                            });\n\n                            var input = document.getElementById(\"prosomo_franchise_pac-input\");\n\n                            var options = {\n                                componentRestrictions: {\n                                    country: [\"ca\", \"us\"]\n                                }\n                            };\n\n                            var autocomplete = new google.maps.places.Autocomplete(input, options);\n\n                            autocomplete.bindTo(\"bounds\", map);\n\n                            autocomplete.setFields([\"address_components\", \"geometry\", \"icon\", \"name\"]);\n\n                            autocomplete.addListener(\"place_changed\", function() {\n\n                                var place = autocomplete.getPlace();\n                                if (!place.geometry) {\n                                    return;\n                                }\n\n                                jQuery(\"#prosomo_franchise_gmlat\").val(place.geometry.location.lat());\n                                jQuery(\"#prosomo_franchise_gmlng\").val(place.geometry.location.lng());\n\n                                var prosomo_franchise_gmlat = place.geometry.location.lat()\n                                var prosomo_franchise_gmlng = place.geometry.location.lng()\n\n                                jQuery.ajax({\n                                    type: \"GET\",\n                                    url : myAjax.ajaxurl,\n                                    data : { action: \"prosomo_franchise_draw_map\", lat: prosomo_franchise_gmlat, lng: prosomo_franchise_gmlng },\n                                    dataType: \"json\",\n                                    success: function(result) {\n                                        jQuery(\"#result\").html(result.results);\n                                        jQuery(\"#map\").html(result.map);\n                                    }\n                                });\n\n                            });\n\n                            \/\/ if POST prosomo_franchise_pac-input is set\n                            \n                        }\n\n                        jQuery(\"#prosomo_franchise_pac-input\").keydown(function(event) {\n\n                            if (event.keyCode == 13) {\n                                event.preventDefault();\n                                return false;\n                            }\n                        });\n\n                        getLatLong();\n\n                    <\/script>\n                <\/div>\n\n                \n                    <div class=\"map_bg\">\n                        \n        <script>\n\n        function isEmpty(obj) {\n            return Object.keys(obj).length === 0 && obj.constructor === Object;\n        }\n\n        function initMap(locations) {\n            all_bounds = new google.maps.LatLngBounds();\n\n            if(locations.franchise_map) {\n                franchise_bounds = new google.maps.LatLngBounds();\n            }\n\n            \/\/ Map options\n            var options = {\n                zoom: 11,\n                center: {lat: 45.4212497, lng: -75.7003181},\n                styles: locations['mapOptions']['style']\n            }\n\n            var map = new google.maps.Map(document.getElementById('map'), options);\n\n            function initMapOnLoad(locations) {\n\n                \/\/ Marker logic\n                if (!isEmpty(locations['markers'])) {\n\n                    Object.entries(locations['markers']).forEach(([group_markers_key, group_markers]) => {\n\n                        Object.entries(group_markers).forEach(([markers_key, markers]) => {\n\n                            \/\/ icon\n                            var customIcon = {\n                                url: markers['pin']['url'],\n                                scaledSize: new google.maps.Size(markers['pin']['size_x'], markers['pin']['size_y']),\n                            };\n\n                            \/\/ Add marker\n                            var marker = new google.maps.Marker({\n                                position: {lat: markers['lat'], lng: markers['lng']},\n                                map: map,\n                                icon: customIcon\n                            });\n\n                            \/\/ InfoWindow content\n                            var infoContent = markers['infowindow'];\n\n                            \/\/ New InfoWindow\n                            var infoWindow = new google.maps.InfoWindow({\n                                content: infoContent\n                            });\n\n                            \/\/ Show InfoWindow when marker is clicked\n                            marker.addListener('click', function() {\n                                infoWindow.open(map, marker);\n                            });\n\n                            \/\/ bound\n                            if(locations.franchise_map && markers['info']['is_current_franchise'] == 1) {\n                                franchise_bounds.extend(marker.getPosition());\n                            } else {\n                                \/\/ bounds.extend(marker.getPosition());\n                            }\n                        });\n                    });\n                }\n\n                \/\/ Polygon Logic\n                if (!isEmpty(locations['polygons'])) {\n\n                    var franchises = locations['polygons'];\n\n                    var franchisesPolygons = [];\n\n                    let z_index = 9999;\n\n                    \/\/ Cities\n                    Object.entries(franchises).forEach(([franchise_id, cities]) => {\n\n                        franchisesPolygons[franchise_id] = [];\n\n                        \/\/ City\n                        Object.entries(cities).forEach(([city_key, city]) => {\n\n                            z_index--;\n\n                            if(city.length == 0) {\n                                return;\n                            }\n\n                            let city_bounds = new google.maps.LatLngBounds();\n\n                            let citySlug = city.label.replace(\/[^a-zA-Z0-9]\/g, '');\n\n                            franchisesPolygons[franchise_id][citySlug] = [];\n\n                            \/\/ Shapes \/ coords outer\n                            let cityCoordsOuter = [];\n\n                            Object.entries(city.coords.outer).forEach(([coords_key, coords]) => {\n                                let testPoly;\n                                franchisesPolygons[franchise_id][citySlug].push(Object.values(coords));\n                                cityCoordsOuter.push(coords);\n\n                                if(locations.franchise_map && city.info.is_current_franchise) {\n                                    coords.forEach(dot => franchise_bounds.extend(dot));\n                                }\n                                coords.forEach(dot => city_bounds.extend(dot));\n                                coords.forEach(dot => all_bounds.extend(dot));\n\n                            });\n\n                            \/\/ Shapes \/ coords inner\n                            let cityCoordsInner = [];\n\n                            Object.entries(city.coords.inner).forEach(([coords_key, coords]) => {\n                                let testPoly;\n                                franchisesPolygons[franchise_id][citySlug].push(Object.values(coords));\n                                cityCoordsInner.push(coords);\n\n                                if(locations.franchise_map && city.info.is_current_franchise) {\n                                    coords.forEach(dot => franchise_bounds.extend(dot));\n                                }\n                                coords.forEach(dot => city_bounds.extend(dot));\n                                coords.forEach(dot => all_bounds.extend(dot));\n\n                            });\n\n                            if (cityCoordsInner[0].length > 0) {\n\n                                cityPolygons = new google.maps.Polygon({\n                                    paths: [cityCoordsOuter[0], cityCoordsInner[0]],\n                                    strokeColor: city.styles.strokeColor,\n                                    strokeOpacity: city.styles.strokeOpacity,\n                                    strokeWeight: city.styles.strokeWeight,\n                                    fillColor: city.styles.fillColor,\n                                    fillOpacity: city.styles.fillOpacity,\n                                });\n\n                            } else {\n\n                                cityPolygons = new google.maps.Polygon({\n                                    paths: cityCoordsOuter,\n                                    strokeColor: city.styles.strokeColor,\n                                    strokeOpacity: city.styles.strokeOpacity,\n                                    strokeWeight: city.styles.strokeWeight,\n                                    fillColor: city.styles.fillColor,\n                                    fillOpacity: city.styles.fillOpacity,\n                                });\n                            }\n\n                            cityPolygons.setMap(map);\n\n                            \/\/ link\n                            google.maps.event.addListener(cityPolygons, \"click\", function(event) {\n                                window.location.href = city.info.permalink \/\/ city.info.permalink\n                            });\n\n\n                            if(city.label.length > 0) {\n\n                                if(!city.lat || !city.lng) {\n                                    return;\n                                }\n\n                                \/\/ Create the labels\n                                var lotCharCount = city.label.length;\n                                var lotSpaceCount = (city.label.match(\/ \/g) || []).length;\n                                lotCharCount -= lotSpaceCount;\n                                var iconPathLength = (lotCharCount * 1.75) + (lotSpaceCount) + 5;\n\n                                var mIcon = {\n                                    path: \"M-\"+iconPathLength+\" -5 L\"+iconPathLength+\" -5 L\"+iconPathLength+\" 5 L-\"+iconPathLength+\" 5 Z\",\n                                    strokeColor: city.labelStyles.strokeColor,\n                                    strokeOpacity: city.labelStyles.strokeOpacity,\n                                    strokeWeight: city.labelStyles.strokeWeight,\n                                    fillColor: city.labelStyles.fillColor,\n                                    fillOpacity: city.labelStyles.fillOpacity,\n                                    scale: 2\n                                };\n\n                                var marker = new google.maps.Marker({\n                                    \/\/ position: city_bounds.getCenter(), \/\/ center in polygon\n                                    position: {lat: city.lat, lng: city.lng}, \/\/ same as regular pin\n                                    title: \"\",\n                                    map: map,\n                                    icon: mIcon,\n                                    label: {color: city.labelStyles.fontColor, fontSize: '14px', fontWeight: '500', text: city.label},\n                                    zIndex: z_index\n                                });\n\n                                \/\/ link\n                                google.maps.event.addListener(marker, \"click\", function(event) {\n                                    window.location.href = city.info.permalink \/\/ city.info.permalink\n                                });\n\n                            }\n                        });\n                    });\n\n\n                    if(locations.franchise_map) {\n                        map.fitBounds(franchise_bounds);\n                    } else {\n                        map.fitBounds(all_bounds);\n                    }\n                }\n            }\n            Window.onload = initMapOnLoad(locations);\n        }\n\n        jQuery(document).ready(function(){\n            jQuery.ajax({\n                type: 'POST',\n                url: myAjax.ajaxurl,\n                data:{\n                    action: 'prosomo_franchise_draw_map_ajax',\n                    post_id: \"0\",\n                    map_id: 'map'\n                },\n                success: function(response){\n                    initMap(JSON.parse(response));\n                }\n            });\n        });\n\n        <\/script>\n\n        \n                        <script>\n                        jQuery( document ).ready(function() {\n                            jQuery(\"#result\").html(\"<div class=\\\"result_item\\\"><h4><a href=\\\"https:\/\/1cleanair.ca\/fr\/franchise\/brossard\/\\\">Brossard<\/a><\/h4><p class=\\\"phone\\\"><strong>T\u00e9l\u00e9phone :<\/strong> <a href=\\\"tel:+15148008048\\\">514-800-8048<\/a><\/p><p class=\\\"email\\\"><strong>Courriel :<\/strong> <a href=\\\"mailto:service@1cleanair.ca\\\">service@1cleanair.ca<\/a><\/p><\/div> <div class=\\\"result_item\\\"><h4><a href=\\\"https:\/\/1cleanair.ca\/fr\/franchise\/cornwall\/\\\">Cornwall<\/a><\/h4><p class=\\\"phone\\\"><strong>T\u00e9l\u00e9phone :<\/strong> <a href=\\\"tel:+16136124828\\\">613-612-4828<\/a><\/p><p class=\\\"email\\\"><strong>Courriel :<\/strong> <a href=\\\"mailto:service@1cleanair.ca\\\">service@1cleanair.ca<\/a><\/p><\/div> <div class=\\\"result_item\\\"><h4><a href=\\\"https:\/\/1cleanair.ca\/fr\/franchise\/gatineau\/\\\">Gatineau<\/a><\/h4><p class=\\\"phone\\\"><strong>T\u00e9l\u00e9phone :<\/strong> <a href=\\\"tel:+18196642444\\\">819-664-2444<\/a><\/p><p class=\\\"email\\\"><strong>Courriel :<\/strong> <a href=\\\"mailto:service@1cleanair.ca\\\">service@1cleanair.ca<\/a><\/p><\/div> <div class=\\\"result_item\\\"><h4><a href=\\\"https:\/\/1cleanair.ca\/fr\/franchise\/kingston\/\\\">Kingston<\/a><\/h4><p class=\\\"phone\\\"><strong>T\u00e9l\u00e9phone :<\/strong> <a href=\\\"tel:+16137770020\\\">613-777-0020<\/a><\/p><p class=\\\"email\\\"><strong>Courriel :<\/strong> <a href=\\\"mailto:service@1cleanair.ca\\\">service@1cleanair.ca<\/a><\/p><\/div> <div class=\\\"result_item\\\"><h4><a href=\\\"https:\/\/1cleanair.ca\/fr\/franchise\/laval\/\\\">Laval<\/a><\/h4><p class=\\\"phone\\\"><strong>T\u00e9l\u00e9phone :<\/strong> <a href=\\\"tel:+15148008048\\\">514-800-8048<\/a><\/p><p class=\\\"email\\\"><strong>Courriel :<\/strong> <a href=\\\"mailto:service@1cleanair.ca\\\">service@1cleanair.ca<\/a><\/p><\/div> <div class=\\\"result_item\\\"><h4><a href=\\\"https:\/\/1cleanair.ca\/fr\/franchise\/montreal\/\\\">Montreal<\/a><\/h4><p class=\\\"phone\\\"><strong>T\u00e9l\u00e9phone :<\/strong> <a href=\\\"tel:+15148008048\\\">514-800-8048<\/a><\/p><p class=\\\"email\\\"><strong>Courriel :<\/strong> <a href=\\\"mailto:service@1cleanair.ca\\\">service@1cleanair.ca<\/a><\/p><\/div> <div class=\\\"result_item\\\"><h4><a href=\\\"https:\/\/1cleanair.ca\/fr\/franchise\/ottawa\/\\\">Ottawa<\/a><\/h4><p class=\\\"phone\\\"><strong>T\u00e9l\u00e9phone :<\/strong> <a href=\\\"tel:+16136124828\\\">613-612-4828<\/a><\/p><p class=\\\"email\\\"><strong>Courriel :<\/strong> <a href=\\\"mailto:service@1cleanair.ca\\\">service@1cleanair.ca<\/a><\/p><\/div> <div class=\\\"result_item\\\"><h4><a href=\\\"https:\/\/1cleanair.ca\/fr\/franchise\/quebec-city\/\\\">Quebec City<\/a><\/h4><p class=\\\"phone\\\"><strong>T\u00e9l\u00e9phone :<\/strong> <a href=\\\"tel:+15812000905\\\">581-200-0905<\/a><\/p><p class=\\\"email\\\"><strong>Courriel :<\/strong> <a href=\\\"mailto:service@1cleanair.ca\\\">service@1cleanair.ca<\/a><\/p><\/div> <div class=\\\"result_item\\\"><h4><a href=\\\"https:\/\/1cleanair.ca\/fr\/franchise\/sainte-therese\/\\\">Sainte-Th\u00e9r\u00e8se<\/a><\/h4><p class=\\\"phone\\\"><strong>T\u00e9l\u00e9phone :<\/strong> <a href=\\\"tel:+15148008048\\\">514-800-8048<\/a><\/p><p class=\\\"email\\\"><strong>Courriel :<\/strong> <a href=\\\"mailto:service@1cleanair.ca\\\">service@1cleanair.ca<\/a><\/p><\/div> <div class=\\\"result_item\\\"><h4><a href=\\\"https:\/\/1cleanair.ca\/fr\/franchise\/toronto\/\\\">Toronto<\/a><\/h4><p class=\\\"phone\\\"><strong>T\u00e9l\u00e9phone :<\/strong> <a href=\\\"tel:+18883301247\\\">1-888-330-1247<\/a><\/p><p class=\\\"email\\\"><strong>Courriel :<\/strong> <a href=\\\"mailto:service@1cleanair.ca\\\">service@1cleanair.ca<\/a><\/p><\/div>\");\n                        });\n                        <\/script>\n                    <\/div>\n                            <\/div>\n            <div class=\"result_group\">\n                <div class=\"franchise_search_result\" id=\"result\"><\/div>\n                <div class=\"franchise_search_map loading\" id=\"map\"><\/div>\n            <\/div>\n        <\/div>\n\n        <\/div>[\/vc_column_inner][\/vc_row_inner][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>[vc_row type=&#8221;in_grid&#8221; text_align=&#8221;inherit&#8221; el_class=&#8221;padding-100&#8243;][vc_column][vc_row_inner type=&#8221;full_width&#8221; text_align=&#8221;inherit&#8221;][vc_column_inner][\/vc_column_inner][\/vc_row_inner][\/vc_column][\/vc_row]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":10,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":""},"class_list":["post-2187","page","type-page","status-publish"],"acf":[],"_links":{"self":[{"href":"https:\/\/1cleanair.ca\/fr\/wp-json\/wp\/v2\/pages\/2187","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1cleanair.ca\/fr\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/1cleanair.ca\/fr\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/1cleanair.ca\/fr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/1cleanair.ca\/fr\/wp-json\/wp\/v2\/comments?post=2187"}],"version-history":[{"count":0,"href":"https:\/\/1cleanair.ca\/fr\/wp-json\/wp\/v2\/pages\/2187\/revisions"}],"wp:attachment":[{"href":"https:\/\/1cleanair.ca\/fr\/wp-json\/wp\/v2\/media?parent=2187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}