About LocationResources
LocationResources is a basic integration between the Google Maps API and MODX Resources.
It allows drag and drop in the MODX manager to position maps and set markers which is then reflected on the web context (or others).Information
Released
August 18, 2017
Supported Database
MySQL
License
GPLv2
Supported Versions
2.3 - Current
Downloads
4,813
Instructions
18.08.2017 - Version 1.3.2
Usage:
------
First add your Google Maps API Key into the system settings. Then, in the manager simply create a new resource of "Location" type. You will see the map displayed above the main resource content field.You can drag the map around and zoom to position it. You can choose to add a marker, position it and add an info window to it.
Remember to save the resource!
Then to have it displayed on your web context:
Call this snippet on any template/chunk attached to the LocationResource: [[locationResourcesMap]]
This will display a map with all the default settings.
For customization, you can call the snippet with currently five parameters:
[[locationResources? &docid=`[resource id here]` &parents=`3,27,9` &tpl=`myCustomTpl` &js=`myCustomJS` &css=`myCustomDefaultCSS`]]
Parameters
==========
&docid
The ID of the resource you wish to pull for map display. Defaults to the current resource if not supplied.
&tpl
Put the name of your custom chunk that contains the main map div.
&js
Put the name of your custom chunk that contains the script to display the map.
&css
Put the name of your custom chunk that contains your own css. (Or you can choose not to use default css in your system settings and style on your own).
&parents
Accepts a comma-separated list of resource ids. If any children of that resource are LocationResources and have a marker set, those markers will be add via clustering top the map.This is in addition to the marker that belongs to the LocationResource controlling the main map. This marker will not be clustered. If you don't want it shown, you can remove it.
New in 1.3.2-pl
Changelog for LocationResources.
LocationResources 1.3.2 (18/08/2017)==============
- Fixed marker bug with quick create.
- Removed all cluster code from output if not using clustering.
- Fixed broken JS caused by /n and /r when using multiple lines for description
- Fixed bug preventing map location to be set before initially saving resource.
LocationResources 1.3.1 (11/08/2017)
==============
- Fix pathing problem to cluster js file.
LocationResources 1.3.0 (11/08/2017)
==============
- Added marker cluster functionality to allow multiple markers on a single map. Values taken from selected LocationResources under specified parents.
- Added &parents parameter that accepts a comma-separated list of resource ids with children containing markers.
- Fixed lexicon values for creating via context menus in the resource tree.
- Added checks to make sure profile record is populated with default values on create.
- Changed marker description field to textarea to allow multi-line descriptions. (Kept same layout for now).
LocationResources 1.2.1 (08/07/2017)
==============
- Forces output of decimals to use dot notation. Some European locales were converting to commas and breaking the map.
LocationResources 1.2.0 (07/07/2017)
==============
- Revised layout in manager
- Added geocoding functionality with a 'Find Address' search field.
- Searching by address removes any current markers and adds a new marker at the found location.
- Added a button that allows the user to centre the map to the marker if one has been added.
LocationResources 1.1.2 (24/03/2017)
==============
- Removed default values from xpdo schema. Default decimal values causing install errors when using a locale that uses commas instead.
- 3 new system settings where map defaults are now stored. After install, the defaults can be set by the developer.
- marker_link_test column added to database for future feature upgrade.
LocationResources 1.1.1 (21/03/2017)
==============
- Fixes div id generation for if the same map is called twice on a resource for some reason.
LocationResources 1.1.0 (19/03/2017)
==============
- Added serialisation to DIV so that map data can be loaded from other resources. This also allows multiple maps with snippets such as pdoTools or getResources.
- Updated documentation
- Added ID to error reports.
- Added namespaced placeholder for docid.
- Added class_key sanity check.
- Make maps responsively scale to center.
Big thanks to @jcdm (Josh Curtis) for the above additions!
- Some aesthetic changes to service class code.
LocationResources 1.0.1
==============
- Fixed changing an existing standard resource into a Location Resource.
- Fixed duplication of Location Resources.
- Updated Lexicon text
LocationResources 1.0.0
==============
- Initial release.