DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

LumoNet Google Map

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed by:Thomas Off
Changed:2006-07-20T15:36:16
Author:Thomas Off, LumoNet oHG
Info 2:
Info 3:
Info 4:

LumoNet Google Map

Extension Key: lumophpinclude

Copyright 2006, Thomas Off, LumoNet oHG, <Thomas Off, LumoNet oHG>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

Content

Introduction 1

What does it do? 1

Screenshots 2

Usage 4

Requirements 4

Installation 4

Configuration 4

Known Bugs 7

ToDo 8

Changelog 9

Introduction

What does it do?

Adds a map from Google Maps to your website.

This extension is based on PHP GoogleMapAPI (http://www.phpinsider.com/php/code/GoogleMapAPI/) by Monte Ohrt which was adapted and partly rewritten to make it more suitable for usage in this extension (e.g. quoting of JavaScript code snippets).

Features:

  • Show locations created as tt_address items
  • Control the size of the map as well as other behaviour (e.g. whether map controls are shown or not)
  • Templatable sidebar which lists the shown locations and can show them in detail once you click on them
  • Templatable info box with support for links and graphics
  • Set center point and default zoom level for the map

Screenshots

Sample frontend view:

img-1

Sample info box:

img-2

Backend: sheet „General“

img-3

Backend: sheet „Data“

img-4

Backend: sheet „Template“

img-5

Usage

Requirements

tt_address >= 1.04

typo3 >= 4.0

Installation

Install the plugin via Extension Manager.

Go to http://www.google.com/apis/maps/ and sign up for your Google Maps API key for your website.

Use the Constant Editor to set the new API key.

Create a new page.

Add a new content element „Google map“ to this page.

Adjust the settings for your map (you can just leave off this step and see the results of the default values).

Look at your new page in the frontend and play around with your map.

Configuration

You can configure the plugin either „locally“, i.e. by using configuration options in the flexform, or „globally“ by TypoScript setup.

The extension adds all supported TS fields and you can browse them via TypoScript object browser from the „Web > Template“ menu item.

All configuration options with description and sample data are listed in the following table:

google_api_key

Property

google_api_key

Data type

string

Description

The Google Maps API key for your website.If you don't have one yet, sign up on http://www.google.com/apis/maps/ for one.

Example:

plugin.tx_lumogooglemaps_pi1.google_api_key = YOUR_API_KEY

Default

template_file

Property

template_file

Data type

string

Description

Path to a template file for map, sidebar and info window;

an example can be found in the sub-directory templates of the plugin.

Example:

plugin.tx_lumogooglemaps_pi1.template_file = fileadmin/templates/googlemaps.html

Default

EXT:lumogooglemaps/templates/template_css.html

default_country

Property

default_country

Data type

string

Description

The default country for geocoding (i.e. conversion of an address into longitude and latitude); valid values are country names and codes as specified in ISO 3166 (country codes); this country code is used for addresses where no country has speciied within the tt_address item

Example:

plugin.tx_lumogooglemaps_pi1.default_country = Germany

Default

Germany

pid_list

Property

pid_list

Data type

string

Description

The page id (pid), or list of pids of the folder(s), where your tt_address items are stored in (also known as “Starting point”). If this value is not set, and the “Starting point” field in the map content-element is also empty, the current page is used.Accepts multiple pids comma separated!

Example:

# clear the value
plugin.tx_lumogooglemaps_pi1.pid_list >
# display tt_address items located in page 582 & 584
plugin.tx_lumogooglemaps_pi1.pid_list = 582,584

Default

recursive

Property

recursive

Data type

string

Description

If this is given, the “pid_list” is extended by the number of recursive levels.

Example:

plugin.tx_lumogooglemaps_pi1.recursive = 3

Default

map

Property

map

Data type

map configuration array

Description

Configuration array for the map;see below for available options

Default

center

Property

center

Data type

center configuration array

Description

Configuration array for the map center;see below for available options

Default

marker

Property

marker

Data type

marker configuration array

Description

Configuration array for the marker icon;see below for available options

Default

width

Property

width

Data type

int+

Description

Width of the image to be displayed

Example:

plugin.tx_lumogooglemaps_pi1.map.width = 400

Default

500

height

Property

height

Data type

int+

Description

Height of the image to be displayed

Example:

plugin.tx_lumogooglemaps_pi1.map.height = 300

Default

500

type

Property

type

Data type

string

Description

Which type of map shall be displayed when creating the map; possible values are:

'map', satellite', 'hybrid' (self explanatory)

Example:

plugin.tx_lumogooglemaps_pi1.map.type = satellite

Default

hybrid

type_controls

Property

type_controls

Data type

string

Description

Controls the way the type controls for switching between map, satellite and hybrid mode are shown; possible values are:

'show', hide' (self explanatory)

Example:

plugin.tx_lumogooglemaps_pi1.map.type_controls = hide

Default

show

zoom

Property

zoom

Data type

string

Description

Default zoom level of the map; valid values are in range from 1 (which is 0.75m/px) to 18 (100 km/px) and 'auto' (which zooms the map so that all markers are visible at once)

Example:

plugin.tx_lumogooglemaps_pi1.map.zoom = 5

Default

auto

Settings for the marker:

Property

Settings for the marker:

All these settings start with „marker.“

longitude

Property

longitude

Data type

string

Description

Longitude of the map's center point

Example:

plugin.tx_lumogooglemaps_pi1.center.longitude = 11.200362

Default

11.200362

latitude

Property

latitude

Data type

string

Description

Latitude of the map's center point

Example:

plugin.tx_lumogooglemaps_pi1.center.latitude = 47.676643

Default

47.676643

show

Property

show

Data type

int

Description

When the map*s center point will be shown; valid values are:0: only show center if no marker is set

1: always show center

Example:

plugin.tx_lumogooglemaps_pi1.center.show = 0

Default

0

Settings for the marker:

Property

Settings for the marker:

All these settings start with „marker.“

icon

Property

icon

Data type

string

Description

Path to the marker icon image file

A sample marker icon and shadow is included in the 'template' directory of the extension

Example:

plugin.tx_lumogooglemaps_pi1.marker.icon = fileadmin/images/my_marker_icon.gif

Default

EXT:lumogooglemaps/templates/marker_icon.png

shadow

Property

shadow

Data type

string

Description

Path to the marker shadow image file

Example:

plugin.tx_lumogooglemaps_pi1.marker.shadow = fileadmin/images/my_marker_shadow.gif

Default

EXT:lumogooglemaps/templates/marker_shadow.png

spot

Property

spot

Data type

point configuration array

Description

Configuration options for the spot coordinates, i.e. the coordinates in the marker icon image where the spot (map point) should be set;

see below for available options

Example:

plugin.tx_lumogooglemaps_pi1.marker.spot {

x =6

y =20

}

Default

info

Property

info

Data type

point configuration array

Description

Configuration options for the info box coordinates, i.e. the coordinates in the marker icon image where the info box should have its origin;

see below for available options

Example:

plugin.tx_lumogooglemaps_pi1.marker.info{

x =5

y =1

}

Default

Settings for marker points (point configuration array): These

Property

Settings for marker points (point configuration array): These settings are available in „map.spot“ and „map.info“ to determine the coordinates of the map spot and the info box in the marker icon.

x

Property

x

Data type

int+

Description

x coordinate of the point in the image; calculated from the image's top left point

Default

y

Property

y

Data type

int+

Description

y coordinate of the point in the image; calculated from the image's top left point

Default

Known Bugs

Currently it is not possible to show two maps on the same page

Please report any other bugs (or suggestions for improvement) to the author of the extension.

ToDo

  • Implement more options from the API class
  • Add field to control whether a tt_address item should be displayed in the map
  • Improve documentation
  • Add possibility to show more than one map on the same page
  • Add option to output JavaScript in page header
  • Add possibility to choose geocoding service to use

Changelog

2006-07-20

  • Added option to set default zoom level for maps
  • Added option to set center point of maps
  • Improved geocoding using new Google Maps service
  • Added TS option to set default country for geocoding
  • Fixed dependencies from tt_address

2006-05-01

Initial release.

img-6 LumoNet Google Map - 10