\MapAPI
Synopsis
class MapAPI
extends ViewableData
{
- // members
- protected string $googleMapKey = '';
- protected string $googleMapId = 'googlemapapi';
- protected string $set_additional_css_classes = '';
- protected integer $width = 800;
- protected integer $height = 600;
- protected array $lines = ;
- protected array $kmlFiles = ;
- protected integer $zoom = 9;
- protected boolean $enableWindowZoom = false;
- protected integer $infoWindowZoom = 13;
- protected string $lang = 'en';
- protected string $center = 'Paris, France';
- protected string $additional_css_classes = '';
- protected boolean $show_inline_map_div_style = true;
- protected $latLongCenter = NULL;
- protected string $jsonMapStyles = '[]';
- protected string $mapType = 'road';
- protected string $content = '';
- protected string $mapService = 'google';
- protected boolean $defaultHideMarker = false;
- protected string $contentMarker = '';
- protected array $markers = ;
- protected boolean $useClusterer = false;
- protected integer $gridSize = 50;
- protected integer $maxZoom = 17;
- protected string $clustererLibraryPath = '/mappable/javascript/google/markerclusterer.js';
- protected boolean $enableAutomaticCenterZoom = false;
- protected integer $maxLng = 1000000;
- protected integer $minLng = 1000000;
- protected integer $maxLat = 1000000;
- protected integer $minLat = 1000000;
- protected $centerLat = NULL;
- protected $centerLng = NULL;
- protected float $coordCoef = 0.01;
- protected $allowFullScreen = NULL;
- // methods
- public void __construct()
- public void setShowInlineMapDivStyle()
- public void setAdditionalCSSClasses()
- public void setMapStyle()
- public void setClusterer()
- public MapAPI setDivId()
- public MapAPI setSize()
- public MapAPI setLang()
- public MapAPI setZoom()
- public MapAPI setInfoWindowZoom()
- public MapAPI setEnableWindowZoom()
- public MapAPI setEnableAutomaticCenterZoom()
- public MapAPI setCenter()
- public MapAPI setMapType()
- public void setAllowFullScreen()
- public MapAPI setLatLongCenter()
- public MapAPI setDefaultHideMarker()
- public string getGoogleMap()
- public string getContent()
- public string geocoding()
- public MapAPI addMarkerByCoords()
- public MapAPI addMarkerByAddress()
- public MapAPI addArrayMarkerByCoords()
- public void addMarkerAsObject()
- public void connectPoints()
- public void forTemplate()
- public MapAPI addKML()
- public void addLine()
- public static void jsonRemoveUnicodeSequences()
- public void generate()
- public void processTemplateHTML()
Hierarchy
Extends
- ViewableData
Tasks
Line | Task |
---|---|
398+ | add proxy settings |
Members
protected
- $additional_css_classes
- $allowFullScreen
- $center
-
$centerLat
map center latitude (horizontal), calculated automatically as markers are added to the map -
$centerLng
map center longitude (vertical), calculated automatically as markers are added to the map - $clustererLibraryPath
-
$content
Content of the HTML generated -
$contentMarker
Extra content (marker, etc...) -
$coordCoef
factor by which to fudge the boundaries so that when we zoom encompass, the markers aren't too close to the edge -
$defaultHideMarker
Hide the marker by default -
$enableAutomaticCenterZoom
Enable automatic center/zoom -
$enableWindowZoom
Enable the zoom of the Infowindow -
$googleMapId
GoogleMap ID for the HTML DIV -
$googleMapKey
GoogleMap key - $gridSize
-
$height
Height of the gmap -
$infoWindowZoom
Default zoom of the Infowindow - $jsonMapStyles
- $kmlFiles
-
$lang
Lang of the gmap - $latLongCenter
- $lines
- $mapService
-
$mapType
Type of the gmap, can be: 'road' (roadmap), 'satellite' (sattelite/aerial photographs) 'hybrid' (hybrid of road and satellite) 'terrain' (terrain) The JavaScript for the mapping service will convert this into a suitable mapping type. - $markers
-
$maxLat
max latitude of all markers -
$maxLng
maximum longitude of all markers - $maxZoom
-
$minLat
min latitude of all markers -
$minLng
minimum longitude of all markers - $set_additional_css_classes
- $show_inline_map_div_style
-
$useClusterer
Use clusterer to display a lot of markers on the gmap -
$width
Width of the gmap -
$zoom
Default zoom of the gmap
Methods
public
- __construct() — Class constructor.
- addArrayMarkerByCoords() — Add marker by an array of coord.
- addKML() — Add a KML file which will be rendered on this map. Normally used for likes of GPS traces from activities.
- addLine()
- addMarkerAsObject() — Adds a {@link ViewableData} object that implements {@link Mappable} to the map.
- addMarkerByAddress() — Add marker by his address.
- addMarkerByCoords() — Add marker by his coord.
- connectPoints() — Draws a line between two {@link ViewableData} objects.
- forTemplate()
- generate() — Generate the gmap.
- geocoding() — Geocoding an address (address -> lat,lng).
- getContent() — Get URL content using cURL.
- getGoogleMap() — Get the google map content.
- jsonRemoveUnicodeSequences()
- processTemplateHTML()
- setAdditionalCSSClasses()
- setAllowFullScreen()
- setCenter() — Set the center of the gmap (an address).
- setClusterer() — Set the useClusterer parameter (optimization to display a lot of marker).
- setDefaultHideMarker() — Set the defaultHideMarker.
- setDivId() — Set the ID of the default gmap DIV.
- setEnableAutomaticCenterZoom() — Enable theautomatic center/zoom at the gmap load.
- setEnableWindowZoom() — Enable the zoom on the marker when you click on it.
- setInfoWindowZoom() — Set the zoom of the infowindow.
- setLang() — Set the lang of the gmap.
- setLatLongCenter() — Set the center of the gmap.
- setMapStyle()
- setMapType() — Set the type of the gmap. Also takes into account legacy settings.
- setShowInlineMapDivStyle()
- setSize() — Set the size of the gmap. If these values are not provided then CSS is used instead.
- setZoom() — Set the zoom of the gmap.