Allow map definitions to provide a default icon
[project/leaflet.git] / leaflet.api.php
1 <?php
2
3 /**
4 * @file
5 * API documentation for Administration menu.
6 */
7
8 /**
9 * Define one or map definitions to be used when rendering a map.
10 * leaflet_map_get_info() will grab every defined map, and the returned
11 * associative array is then passed to leaflet_render_map(), along with a
12 * collection of features.
13 *
14 * The settings array maps to the settings available
15 * to leaflet map object, http://leaflet.cloudmade.com/reference.html#map-properties
16 *
17 * Layers are the available base layers for the map and, if you enable the
18 * layer control, can be toggled on the map.
19 *
20 * @return array
21 */
22 function hook_leaflet_map_info() {
23 return array(
24 'OSM Mapnik' =>
25 array(
26 'label' => 'OSM Mapnik',
27 'description' => t('Leaflet default map.'),
28 'settings' => array(
29 'dragging' => TRUE,
30 'touchZoom' => TRUE,
31 'scrollWheelZoom' => TRUE,
32 'doubleClickZoom' => TRUE,
33 'zoomControl' => TRUE,
34 'attributionControl' => TRUE,
35 'trackResize' => TRUE,
36 'fadeAnimation' => TRUE,
37 'zoomAnimation' => TRUE,
38 'closePopupOnClick' => TRUE,
39 'layerControl' => TRUE,
40 // 'minZoom' => 10,
41 // 'maxZoom' => 15,
42 // 'zoom' => 15, // set the map zoom fixed to 15
43 ),
44 'layers' => array(
45 'earth' => array(
46 'urlTemplate' => 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
47 'options' => array(
48 'attribution' => 'OSM Mapnik'
49 )
50 ),
51 ),
52 // Uncomment the lines below to use a custom icon
53 // 'icon' => array(
54 // 'iconUrl' => '/sites/default/files/icon.png',
55 // 'iconSize' => array('x' => '20', 'y' => '40'),
56 // 'iconAnchor' => array('x' => '20', 'y' => '40'),
57 // 'popupAnchor' => array('x' => '-8', 'y' => '-32'),
58 // 'shadowUrl' => '/sites/default/files/icon-shadow.png',
59 // 'shadowSize' => array('x' => '25', 'y' => '27'),
60 // 'shadowAnchor' => array('x' => '0', 'y' => '27'),
61 // ),
62 );
63 }