• Resolved edgepro

    (@edgepro)


    Are there any recommended Google Map Plugins that work best with MPG? Is it better or just as easy to code these myself? I’m looking to show a downtown area and place custom pins (locations) with their own custom markers if at all possible on each city’s page.

    Also, is there a way for MPG to direct itself to the page of the closest GPS coordinates in my list via some sort of automatic mobile device location search page? Are there examples of how others may have accomplished this with your plugin?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi, Edgepro

    It’s not too hard to add maps manually. This is a tutorial

    You can check user’s country by IP, and then find all cities in this country and show it randomly
    Like this:

    
    echo do_shortcode('[mpg project-id="1" where="mpg_city=${{' . $user_city_name . '}}" limit="10" direction="random"]
    ? ? ?{{mpg_city_name}}
    [/mpg]');
    

    ?
    I.e. you can get nearby cities by name, but not by lat and long.
    p.s: To execute code above, you need to implement support of PHP code in a post \ page.
    Try to use plugins like “PHP everywhere”.

    Regards

    Thread Starter edgepro

    (@edgepro)

    Great info! Thanks!

    I already started playing around with the Google Maps API and I’m already getting it to do what I want- yes, it’s pretty easy aside from trying to style the markers and icons, but I’m really close.

    On the city thing, is there a way to search for a matching ZIP & return a city?

    If you have in the source-file columns like mpg_city and mpg_zip_code, you can write something like

    
    [mpg project-id="1" where="mpg_zip_code=10003"]
        City name for requested zip is {{mpg_city}}
    [/mpg]
    

    Take a look at this doc, probably, it will be useful
    https://docs.mpgwp.com/article/12-how-to-generate-list-of-mpg-pages

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Best Google Map Plugin For MPG’ is closed to new replies.