MidCOM wrapper class for map display via the mapstraction library

Example usage:

$map = new org_routamc_positioning_map('my_example_map'); $map->add_object($article); $map->add_object($another_article); $map->show();

package org.routamc.positioning

 Methods

__construct (string $id, $type)

Constructor

Parameters

$id

stringId string for the map

$type

add_jsfiles ($echo_output)

Include the javascript files and code needed for map display

Parameters

$echo_output

add_marker (array $marker)

Add a marker to the map

Marker array should contain the following:

  • coordinates array with latitude, longitude (and possibly altitude)
  • title string

In addition it may contain:

  • abstract string containing HTML to be shown in the infobubble
  • icon string URL to image file

Parameters

$marker

arrayMarker array

Returns

booleanWhether the operation was successful

add_object ($object, $icon)

Add an object to the map

Parameters

$object

$icon

Returns

boolean

create_js_marker ($marker, $script)

Create a marker javascript object and return its name

Parameters

$marker

$script

show (integer $width, integer $height, integer $zoom_level, boolean $echo_output)

Display the map

Parameters

$width

integerWidth of the map in pixels

$height

integerHeight of the map in pixels

$zoom_level

integerZoom level of the map. Leave to null for autozoom

$echo_output

booleanWhether output should be echoed or returned

 Properties

 

mixed $api_key

API key to use with the mapping service, if needed
access private
 

mixed $id

ID of the map
access private
 

mixed $markers

Markers to display on the map
access private
 

mixed $type

Type of the map to use
access private
 

mixed $zoom_level

Set map zoom level to this value (note: effect of zoom level varies by map provider)