OSM Autofill Issues.

Support MB Geolocation OSM Autofill Issues.Resolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #36724
    JamesJames
    Participant

    I was trying to get meta-box-geolocation to autofill component fields from OSM today and I ran into a couple issues.

    First geolocation.js is enqueued like this by geolocation.php(30):

    
    $is_google_map = $this->check_type_google_map( $meta_box->meta_box );
      if ( true === $is_google_map ) {
        $this->register_google_maps_scripts( $meta_box->geo );
      }
      list( , $url ) = RWMB_Loader::get_path( __DIR__ );
      wp_enqueue_script( 'mb-geolocation', $url . 'geolocation.js', ['google-maps', 'jquery', 'underscore'], filemtime( __DIR__ . '/geolocation.js' ), true );
    

    As a result of google-maps being a dependency in wp_enqueue_script, geolocation.js never loads when only using OSM. I know this is something you've been working on so my apologies if it has already been addressed.

    Next on line 7 of geolocation.js:

    
    this.addressFields = container.querySelectorAll( '.rwmb-text[name^="address"], .rwmb-text[name*="[address"]' );
    

    I believe there is a typo in the brackets of the second query statement's attribute selector.

    I think this should read .rwmb-text[name*="address"], otherwise no fields beyond lat,lng ever populate.

    #36729
    Long NguyenLong Nguyen
    Moderator

    Hi James,

    Thanks for your feedback, I really appreciate it.

    The issues with dependency and typo have been added to our development queue. It will be fixed in the next update.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.