Maps are used all over DPCalendar, for example there is a map shown below the calendar or the event details page. We even have maps menu items or modules. Maps are loaded through Javascript and do display a part of the earth. The user is able then to zoom in or out, go into full screen or navigate around. For better navigation we have implemented an intelligent gesture handling, means the user has on desktop's to use ctrl + scroll to change the zoom and on touch devices two fingers are needed.
There are different online services which do offer map data as tiles or geolocation information. DPCalendar supports the following map providers:
Mostly the map providers do offer free usage for low limits, for example you can do up to 28'000 loads per month on Google maps. Because of that you mostly need an account on one of these map providers. DPCalendar is rendering the maps not before they are visible in the viewport. So it speeds up the page load as map loading is a heavy operation.
In the DPCalendar options when you open the Integration tab, then you see a drop down where you can define your preferred map provider. Every map provider has different settings which are needed to properly run and display the maps.
Every view or module which displays a map allows to set an initial state like the coordinates or zoom level. Thes configuration is only used initially as the map automatically adjusts to the marker bounds and optimizes the zoom level automatically.
Markers which are close to each other, will be clustered like that are the maps not overloaded with many events. As default, markers which are within a radius of 30 pixels, will be shown as a cluster. If the admin wants to adjust the cluster, an override of the map layout can be done and a data attribute with the name radius can be specified.
When creating a location, DPCalendar fetches the latitude and longitude information for the given location. This information is also fetched from the selected map provider. Geolocation is a service which maps addresses to geographic coordinates.
When creating a location, there is a drop down available for quick location lookup. The same input box is also available when search within a radius in the list, blog, timeline and map menu item. It shows a list of suggestions. These suggestions are also fetched in a live request from the selected map provider.
To be inline with the privacy regulations of your country it can be that it is required to ask for consent before loading external scripts. When you are using a tiles server which doesn't belong to you or you are using a service from OpenStreetmap, Google or somebody else then external scripts are loaded and some private information like the IP address is sent to the service. To avoid that, you can enable ask for consent in the DPCalendar options in the integration tab and then the user has to actively click into the map area before it gets loaded. An information string is shown as well. If you want to change it, then make a language override of the key COM_DPCALENDAR_FIELD_CONFIG_INTEGRATION_MAP_CONSENT_INFO_TEXT as described in the article Multilanguage. If you want to style the element differently, then you can use the CSS class dp-map_consent.
Comments (0)