• (widget) Google maps widget#

  • oori Reply #1, 2 years ago

    Reply
    Disclaimer: this is a quick solution, haven't tested it on various browsers and setups. It is not supported by me. In case of bugs - it is release for free in the wild, feel free to fix and change.


    This widget allows backend editors to set geolocation on a map.
    The result tv will contain the Lat+Lng, which can later be used with your favorite map (whether via php backend or client js, there's a million ready-made solution around)

    googlemap v0.11 - Features:
    - Based on Google Maps api v2
    - Support multiple maps in single document
    - Double click to set marker
    - Drag and drop support to move markers
    - Address search support (with multiple results)
    
    
    
    
    How to:
    
    1. Copy googlemap folder to /assets/plugins/managermanager/widgets
    2. Create one or more TVs that will hold the geolocation (with 'Input Type' as 'Text')
    3. Add rule to your mm_rules:  mm_widget_googlemap(fields, apiKey, default, roles, templates)
    (mandatory) 'fields' is the TV name(s)
    (mandatory) 'apiKey' (free) Google Maps API Key (optional when working on localhost dev server)
    (optional) 'default' is the default position of the map
    
    Examples:
    minimal (note, no api works only on localhost afaik):
    mm_widget_googlemap('someTv');
    
    full (2 maps, api key, default location):
    mm_widget_googlemap('eventLocation,nearestTrainStation','long-long-api-key','35.1516,126.8665');
    




    Good luck


  • oori Reply #2, 2 years ago

    Reply
    v0.11 uploaded (in original post)
    small change - added the forgotten api key setting...
    when testing on localhost, it should work without any key (just leave that field empty).
    on production server, get one free at: http://code.google.com/apis/maps/signup.html

    mm_widget_googlemap($fields, $default='',$googleApiKey='', $roles='', $templates='')


  • taiyo1578 Reply #3, 1 year, 8 months ago

    Reply
    I think this is really smart. Thank you for the contribution and your time. I wish I had the brains to use this properly but I'm hoping someone might be able to help.

    The end result I'm looking for is to generate a Google Map with Streetview for multiple properties. I have the address stored as a variable and need a way to get the Longitude and Latitude for each address and automatically generate the Google map (without any input from a user).

    Would anyone be able to lend a hand and help me get over the hump?

    Thanks!


  • sharkbait Reply #4, 1 year, 3 months ago

    Reply
    hey oori,

    this is looking nice, will try it later - thanks for sharing!

    j

    edit: holy moly, this is awesome!


  • ian_m Reply #5, 1 year, 2 months ago

    Reply
    Any ideas how to get this working with Revolution as there is no plugins folder.

    Cheers


  • oori Reply #6, 1 year, 2 months ago

    Reply
    This is for Evo's managermanager, it will not work in Revo.
    Look at this: http://modx.com/extras/package/googlemapstv


  • MrDutchy Reply #7, 1 year, 1 month ago

    Reply
    Thanks a bunch for this. In the past I used address based markers. But now I need markers on arbitrary locations so this should prove very handy! I will definitely give this a try soon!

    I see it uses maps api v2, which requires a domain specific key. V3 would ease the setup/launch to production. Not a big deal though. If I can manage to get it to work with v3 I will share.