• There are two instances where I need the map to fill/draw/update:

    1. In admin, if the map is hidden on page load (postbox closed), and then unhidden, the map doesn’t fill properly.

    2. When using ‘Locate Me’ the map doesn’t zoom/move to the located address.

    I tried invoking addresspickerMap.addresspicker( “updatePosition”); in a few places, but nothing is happening.

    Do I need to edit plugin files, or is there a way to hook in?

    https://wordpress.org/plugins/geo-my-wp/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Eyal Fitoussi

    (@ninjew)

    It sounds like a bug. I am going to look into that and fix it if needed. I will keep you updated.

    Thread Starter TCBarrett

    (@tcbarrett)

    The GMap object has to be globally available to manipulate, so I updated jquery.ui.addresspicker.js

    this.gmap = new google.maps.Map(this.mapElement[0], this.options.mapOptions);
          window.locationMap = this.gmap;
          this.gmarker = new google.maps.Marker({
            position: this.options.mapOptions.center,
            map:this.gmap,
            draggable: this.options.draggableMarker});
          google.maps.event.addListener(this.gmarker, 'dragend', $.proxy(this._markerMoved, this));
          window.locationMarker = this.gmarker;

    Then on location success:

    var mapCentre = new google.maps.LatLng( $('#_wppl_lat').val(), $('#_wppl_long').val() );
                google.maps.event.trigger( window.locationMap, 'resize' );
                window.locationMap.setCenter( mapCentre );
                window.locationMarker.setPosition( mapCentre );

    HTH

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Trigger map refresh’ is closed to new replies.