Title: Trigger map refresh
Last modified: August 21, 2016

---

# Trigger map refresh

 *  [TCBarrett](https://wordpress.org/support/users/tcbarrett/)
 * (@tcbarrett)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/trigger-map-refresh/)
 * 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/](https://wordpress.org/plugins/geo-my-wp/)

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

 *  Plugin Author [Eyal Fitoussi](https://wordpress.org/support/users/ninjew/)
 * (@ninjew)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/trigger-map-refresh/#post-5055688)
 * 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](https://wordpress.org/support/users/tcbarrett/)
 * (@tcbarrett)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/trigger-map-refresh/#post-5055722)
 * 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.

 * ![](https://ps.w.org/geo-my-wp/assets/icon-256x256.gif?rev=2803407)
 * [GEO my WP](https://wordpress.org/plugins/geo-my-wp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/geo-my-wp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/geo-my-wp/)
 * [Active Topics](https://wordpress.org/support/plugin/geo-my-wp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/geo-my-wp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/geo-my-wp/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [TCBarrett](https://wordpress.org/support/users/tcbarrett/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/trigger-map-refresh/#post-5055722)
 * Status: not resolved