Gojo Paradiso

Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • in reply to: Safe way to update javascript for polygons #363080

    Gojo Paradiso
    Free User
    Post count: 9

    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.

    in reply to: Safe way to update javascript for polygons #362592

    Gojo Paradiso
    Free User
    Post count: 9

    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.

    in reply to: Safe way to update javascript for polygons #362399

    Gojo Paradiso
    Free User
    Post count: 9

    It works on the add listing page and not the location page.

    in reply to: Safe way to update javascript for polygons #362179

    Gojo Paradiso
    Free User
    Post count: 9

    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.

    in reply to: Safe way to update javascript for polygons #361928

    Gojo Paradiso
    Free User
    Post count: 9

    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.

Viewing 5 posts - 1 through 5 (of 5 total)
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount