• MODX.com

    2,579 downloads

LocationResources

LocationResources is an extra by digitalpenguin, first released on 2019-11-27.

Package Description

**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.

Usage/Installation Instructions

LocationResources ================= ***Google Maps Custom Resource Class Extra for MODX Revolution*** 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). 27/11/2019 - **Version 1.4.0** NEW - Usage with getResources ---- _Note: If you're not familiar with getResources, start with the "Normal Usage" instructions further below._ Make sure you have the getResources extra installed from the MODX package manager and your Google Maps API key is in the system settings. Create your location resource(s). Make a normal getResources snippet call and include your location resource(s). For example if I have resource (id: 18) which is a parent and includes a list of location resources then I might call getResources like this: ``` ``` Create a chunk called `myCustomTpl` or whatever you fancy. Inside the chunk you can call the location values directly as placeholders with a `location_` prefix. ```

This chunk displays the values of this location resource.

  • Latitude:
  • Longitude:
  • Zoom Level:
  • Does the Map Have a Marker?:
  • Marker Latitude:
  • Marker Longitude:
  • Marker Title:
  • Marker Description:
  • Marker Link (href):
  • Marker Link Text :
``` You can then of course display maps however you like using these values. Normal 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: `````` This will display a map with all the default settings. For customization, you can call the snippet with five parameters: ``` ``` 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.

Details

Developer(s)
digitalpenguin
Released
2019-11-27
First seen
2019-11-27
License
GPLv2
Supported databases
MySQL
Minimum MODX Requirement
2.3

LocationResources Releases

Vendor Signature Released on
MODX.com 1.4.0-pl 2019-11-27 (1 year ago)
MODX.com 1.3.2-pl 2017-08-18 (3 years ago)

We've also seen 6 unverified versions of LocationResources in use, but don't list those as we've been unable of confirming they are official releases from an official source.