Skip to content
This repository has been archived by the owner on Dec 28, 2020. It is now read-only.

Location Maps

Chris Carlevato edited this page Mar 27, 2017 · 1 revision

Helios Calendar makes use of the Google Maps API, embedding maps for event locations, in two ways.

Event Detail Map

One of the many benefits of using Saved Locations over Custom Locations is the inclusion of a Google Map in the event details. For an event to include a location map the event must be assigned to a Saved Location with geocode data.

Browse By Location

An optional feature, the Location Browse map allows public calendar users to view a Google Map with pushpins of all Saved Locations that have active events. Each pushpin includes an info window containing information about the Location (including Physical Address, Website Link & Geocode Coordinates) as well as a custom menu of location tools allowing access to view the location's profile, browse the location's events, as well as to subscribe to the location's iCalendar and RSS event feeds.

The Location Browse Map requires:

  1. Location Browse setting set to “On”.
  2. Location Browse Map Center Geocode data setting.
  3. Locations with Geocode data & active events.

These settings can be configured within your admin console API Settings.

Note: Only Saved Locations with active events are displayed in the Location Browse map. When a new location is added, or once all of the events for a location have passed, it will not be available on the map until new events are added.

Custom Map Pushpins

Helios Calendar includes a variety of custom map pushpins icons in use within it's maps. These icons are located in the /img/pins directory and map pushpins can be customized to users' preference by one of two methods:

  1. Overwriting the default pushpin images (not preferred as it is not upgrade-proof).
  2. Customizing the pushpin code within your custom theme JavaScript (Recommended).

The pushpin JavaScript code is located in the following files and line numbers.

Note: The line numbers for your custom theme may vary depending on the previous modifications made to it.

Event Details Map

/themes/default/event.php Line 50

icon: '<?php gmap_pin_icon();?>'

Location Profile Map

/themes/default/location.php Line 55

icon: '<?php gmap_pin_icon();?>'

Location Browse Map

“Near Me” Pushpin

/themes/default/map.php Line 107

icon: '<?php gmap_pin_icon(cal_url().'/img/pins/me.png');?>',

Location Pushpins

/themes/default/map.php Line 140

icon: '<?php gmap_pin_icon(cal_url().'/img/pins/default.png');?>'

Using Custom Pins

Version 2.1+

Map functions in 2.1 and newer accept pin icon parameters directly (without intermediary functions). Pin icons can be customized by changing the function call within the theme to use any custom pin icon/graphic.

Version 2.0.x

To use a custom pin in place of the default pin simply change the URL passed to the gmap_pin_icon() function to the (full) URL of the pin icon you wish to use.

Example:

If your custom pin icon is in your theme's image directory you would use:

icon: '<?php gmap_pin_icon(theme_dir().'/img/my_pin.png');?>'

If your custom pin was in your root Helios Calendar images directory (as the default pins are) you would use:

icon: '<?php gmap_pin_icon(cal_url().'/img/my_pin.png');?>'

Or if your custom pin was in another directory on your site you would use:

icon: '<?php gmap_pin_icon('http://www.mydomain.com/images/my_pin.png');?>'

Clone this wiki locally