General

  eZ Systems Website
  Editor documentation


  Developer documentation

  Back to the top

The documentation is moving!

We're moving our developer docs to Github and a new site.
The migration is still in progress, so please contact us in #documentation-contrib on eZ Community Slack if you have any questions or feedback.

This space will not be updated from now on except for critical fixes.

Skip to end of metadata
Go to start of metadata

This Field Type represents a geographical location.

NameInternal nameExpected input
MapLocationezgmaplocationmixed

Description

This Field Type makes possible to store and retrieve a geographical location.

As input it expects two float values, latitude, longitude, and a string value in third place, corresponding to the name or address of the location.

PHP API Field Type 

Input expectations

TypeExample
array
array( 'latitude' => 59.928732, 'longitude' => 10.777888, 'address' => "eZ Systems Norge" )

Value object

Properties

The Value class of this Field Type contains the following properties:

PropertyTypeDescription
$latitude floatThis property will store the latitude value of the map location reference.
$longitude
floatThis property will store the longitude value of the map location reference.
$addressstringThis property will store the address of map location.
Constructor

The MapLocation\Value constructor will initialize a new Value object with the values provided. Two floats and a string are expected.

Constructor example

Template rendering

The template called by the ez_render_field() Twig function while rendering a Map Location field accepts the following the parameters:

ParameterTypeDefaultDescription
mapTypestring"ROADMAP"One of the GMap type of map
showMapbooleantrueWhether to show a Google Map
showInfoboooleantrueWhether to show a latitude, longitude and the address outside of the map
zoominteger13The initial zoom level on the map
draggablebooleantrue

Whether to enable draggable map

widthstring|false"500px"

The width of the rendered map with its unit (for example "500px" or "50em"), set to false to not set any width style inline.

heightstring|false"200px"

The height of the rendered map with its unit (for example "200px" or "20em"), set to false to not set any height style inline.

scrollWheelbooleantrue>= 1.7.4, 1.9.1, 1.10.0 Allows you to disable scroll wheel starting to zoom when mouse comes over the map as user scrolls down a page.

Example:

Configuration

>= 1.7.4, 1.9.1, 1.10.0 

ConfigSite Access/Group awareDescription
api_keys.google_mapsyesGoogle maps requires use of a API key for severing maps to web pages, this setting allows you to specify your personal Google Maps API key used during template rendering.

Example use:

ezplatform.yml