Gojo Paradiso
Forum Replies Created
-
AuthorPosts
-
Hi Stiofan,
Thank you for the response it’s mostly working now!
setTimeout works if I set it to 3000ms but it seems to ignore the idle event until the map has been dragged.
Thank you.
Hi Stiofan,
Could you try either of these scripts on the location page?
<script> jQuery(document).ready(function() { // Define the LatLng coordinates for the polygon's path. var triangleCoords = [ {lat: 34.996, lng: 135.761}, {lat: 34.995, lng: 135.771}, {lat: 34.989, lng: 135.771}, {lat: 34.989, lng: 135.761}, {lat: 34.996, lng: 135.761} ]; // Construct the polygon. var bermudaTriangle = new google.maps.Polygon({ paths: triangleCoords, strokeColor: '#FF0000', strokeOpacity: 0.8, strokeWeight: 4, fillColor: '#FF0000', fillOpacity: 0 }); bermudaTriangle.setMap(jQuery.goMap.map); console.log(jQuery.goMap.map); }); </script>
<script> jQuery(document).ready(function() { google.maps.event.addListenerOnce(jQuery.goMap.map, 'bounds_changed', function(){ // Define the LatLng coordinates for the polygon's path. var triangleCoords = [ {lat: 34.996, lng: 135.761}, {lat: 34.995, lng: 135.771}, {lat: 34.989, lng: 135.771}, {lat: 34.989, lng: 135.761}, {lat: 34.996, lng: 135.761} ]; // Construct the polygon. var bermudaTriangle = new google.maps.Polygon({ paths: triangleCoords, strokeColor: '#FF0000', strokeOpacity: 0.8, strokeWeight: 4, fillColor: '#FF0000', fillOpacity: 0 }); bermudaTriangle.setMap(jQuery.goMap.map); console.log(jQuery.goMap.map); }); }); </script>
Thank you.
It works on the add listing page and not the location page.
Hi Stiofan,
I’ve tried wrapping it in (document).ready and (window).load but on the /location/ page it’s always undefined, however, for some reason it works without anything but the script alone on /add-listing/?listing_type=gd_place page.
I also tried wrapping it with google.maps.event.addListenerOnce(jQuery.goMap.map, ‘bounds_changed’, function(){ }); or with idle in place of bounds_changed and it gives me a TypeError or ReferenceError depending on if I try this.map, map, or goMap.map.
Add-listing only has one default style marker on it but location has the GD style markers. Could there be something happening on the location page that causes goMap to be out of scope?
Thank you.
Hi Stiofan,
Thank you for the reply.
I tried using jQuery.goMap.map in both the header and footer but logging the console jQuery.goMap.map is undefined and jQuery.goMap is an empty object.
Is there another place I could call it where goMap is still visible?
Thank you.
-
AuthorPosts