LocationResources 1.3.2-plReleased Aug 18, 2017 by muzzstick
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). Download 93kb (96 downloads)
Google Maps Custom Resource Class Extra for MODX Revolution.
There is no need to use multiple template variables to achieve a similar result.
LocationResources includes a slick drag and drop interface users will love. Both simple and customizable.
18.08.2017 - Version 1.3.2
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`]]
The ID of the resource you wish to pull for map display. Defaults to the current resource if not supplied.
Put the name of your custom chunk that contains the main map div.
Put the name of your custom chunk that contains the script to display the map.
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).
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.
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.
- Fixed changing an existing standard resource into a Location Resource.
- Fixed duplication of Location Resources.
- Updated Lexicon text
- Initial release.
|10 Versions||1 Contributors||550 Downloads|
|1.3.1-pl||Aug, 11 2017||muzzstick||40|
|1.3.0-pl||Aug, 11 2017||muzzstick||14|
|1.2.1-pl||Jul, 08 2017||muzzstick||68|
|1.2.0-pl||Jul, 07 2017||muzzstick||24|
|1.1.2-pl||Mar, 24 2017||muzzstick||125|
|1.1.1-pl||Mar, 21 2017||muzzstick||39|
|1.1.0-pl||Mar, 19 2017||muzzstick||23|
|1.0.1-pl||Mar, 16 2017||muzzstick||46|
|1.0.0-pl||Feb, 03 2017||muzzstick||75|