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