.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt .. role:: underline ============================ EXT: Netcos Google Map fixed ============================ :Created: 2007-10-05T16:19:04 :Changed: 2009-04-15T14:19:24 :Author: Bernd Warken :Email: be.warken@netcos.de :Info 3: :Info 4: .. _EXT-Netcos-Google-Map-fixed: EXT: Netcos Google Map fixed ============================ by *Bernd Warken* at *netcos AG* Extension Key: **netcos\_googlemap\_fixed** Copyright 2007,2008 Bernd Warken, This document is published under the *General Public License* ( *GPL* ) version 3available from `:underline:`http://www.gnu.org/licenses/gpl.html` `_ The content of this document is related to TYPO3- a GNU/GPL CMS/Framework available from `http://www.typo3.com `_ .. _Table-of-Contents: Table of Contents ----------------- .. ### BEGIN~OF~TABLE ### .. _EXT-Netcos-Google-Map-fixed-1: **EXT: Netcos Google Map fixed 1** ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. container:: table-row a **EXT: Netcos Google Map fixed 1** **Introduction 1** What does it do? 1 Technical Details 1 b **Installation 2** Google Map Key 2 Configuration 2 Geocoding 3 Brute Force: changing of a Source Code File 3 Make it run 4 .. ###### END~OF~TABLE ###### .. _Introduction: Introduction ------------ .. _What-does-it-do: What does it do? ^^^^^^^^^^^^^^^^ This TYPO3 extension provides the possibility to display a Google Map within a TYPO3 installation. You can change the size of the map, its center, its zoom level, and its map type in a TypoScript configuration. You do not need to change any file of the extension source code. You can only use a single map on each page, but you can display it as many times as you like. By changing the TypoScript configuration, you can display different maps on different pages. To display several maps on a single page, use the extension *netcos\_googlemap* . .. _Technical-Details: Technical Details ^^^^^^^^^^^^^^^^^ This extension was developed and tested on TYPO3 version 4.1.2 up to 4.1.6. It might run on other TYPO3 versions as well, but I did not test it. At `http://www.netcos-typo3.de `_ , you can find some TYPO3 tutorials on the extensions written at netcos AG. One of these is about this extension. It mentions the details of its generation and the background of its source code. .. _Installation: Installation ------------ You can easily install this extension in the *Ext Manager* without problems. But in order to use it, you should add a TypoScript configuration. .. _Google-Map-Key: Google Map Key ^^^^^^^^^^^^^^ First you need a URL for your website or domain. For this URL, you can get a key for your Google map at `http://google.com/apis/maps `_ . This key may be stored in a constant within the TypoScript template, e.g. .. ### BEGIN~OF~TABLE ### .. _google-map-key-ABQIAAAARokCoxWjWuwH4eEaCOyBkBQuBzwEBiC-X9c-oZXEt: google\_map\_key = ABQIAAAARokCoxWjWuwH4eEaCOyBkBQuBzwEBiC\_X9c-oZXEt- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .. container:: table-row a google\_map\_key = ABQIAAAARokCoxWjWuwH4eEaCOyBkBQuBzwEBiC\_X9c-oZXEt- cQ-gHLphTNVyn1sryGsgMB2Ixb3PPPObdpOw .. ###### END~OF~TABLE ###### Remove the line break. This is just an example, it won't work. A script for the Google map must be called by the following commands in TypoScript template setup: .. ### BEGIN~OF~TABLE ### .. _page-headerData-900-TEXT: page.headerData.900 = TEXT """""""""""""""""""""""""" .. container:: table-row a page.headerData.900 = TEXT page.headerData.900.value ( ) .. ###### END~OF~TABLE ###### You are free to choose a different value than 900. You just have to be sure that no other *page.headerData* exists with the same value. .. _Configuration: Configuration ^^^^^^^^^^^^^ You need to add 6 fields to the configuration of a TypoScript setup (constants won't work). For example, you can use the following configuration: .. ### BEGIN~OF~TABLE ### .. _plugin-tx-netcosgooglemapfixed-pi1: plugin.tx\_netcosgooglemapfixed\_pi1 { """""""""""""""""""""""""""""""""""""" .. container:: table-row a plugin.tx\_netcosgooglemapfixed\_pi1 { width = 500 height = 600 latitude = 48.2 longitude = 11.2 zoom\_level = 15 map\_type = NORMAL } .. ###### END~OF~TABLE ###### The value of *width* is a positive integer. The value of *height* is a positive integer. The width and the height are values in pixels of the frame in which the map is drown. Do not add any characters for the unit, etc. The value of *latitude* is a decimal number (float) with a dot as separating character. It signifies the latitude of the position in which the map is centered. Do not use arc units. The value of *longitude* is a decimal number (float) with a dot as separating character. It signifies the longitude of the position in which the map is centered. Do not use arc units. Latitude and longitude of a position can be determined in the internet, e.g. at the Google map; for a description, see *Google Code FAQ - Tutorial: Creating Your First Map* at `http://code.google.com/support/bin/answer.py?answer=74725&topic=11364 `_ . For other sites, look at Google for something like *latitude longitude finder* . For example, `http://www.satsig.net/maps/lat- long-finder.htm `_ will do. An exactness of about 5 decimals for both values is sufficient for most positions. The *zoom level* is a positive integer less than 20. It regulates the details shown on the map. - *Zoom level* 1 displays the whole globe. - *Zoom level* 13 displays a village or district. - *Zoom level* 15 displays a street. - *Zoom level* 19 displays a house. The *map type* is a string that regulates the display mode of the map. Google has the following modes: - *NORMAL* displays a map without satellite pictures. - *SATELLITE* displays the map as a satellite picture. - *HYBRID* displays the satellite photo together with streets and their names taken from the normal map. .. _Geocoding: Geocoding ^^^^^^^^^ The latitude and the longitude must be determined. You can do this with many sites you find at the Google search engine. But Google map provides this feature, too. You find a description in a Google map API FAQ called *Tutorial: Creating Your First Map* at section 3. This is available at `http://code.google.com/support/bin/answer.py?answer=74725&topic=11364 `_ . Load the place for your latitude and longitude at the normal Google map in the internet. Then click the button *Link to this page* at the top right. This produces a form with one or more information fields. Choose the 2 numbers at the parameter *ll* (double L). These are decimals for the latitude and the longitude. You can use these numbers for the configuration of this extension. .. _Brute-Force-changing-of-a-Source-Code-File: Brute Force: changing of a Source Code File ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ It is no longer necessary to change any source code file. So you can ignore this section. But if you want to change the source code anyway just go ahead. For proper working, you must set and uncomment 6 variables in the `extension source code `_ file **pi1/class.tx\_netcosgooglemapfixed\_pi1.php** `. `_ `In order to be allowed to change an extension source code file you have to disable the button for `_ ` **noEdit** `_ `in the TYPO3 `_ ` *Install* `_ `tool. `_ `After having installed the extension, you can go to `_ ` *Loaded extensions* `_ `in the `_ ` *Ext Manager* `_ `. There you click the name of the extension `_ ` *Netcos Google Map fixed* `_ `. Instead of `_ ` *Information,* `_ `you choose the menu button `_ ` *Edit files* `_ `. Then all files of this extension are shown. You choose `_ ` *Edit file* `_ `of `_ ` **pi1/class.tx\_netcosgooglemapfixed\_pi1.php** `_ `. The editor opens for this file. `_ `In this file, you have to change the 6 variables `_ ` *$width* `_ `, `_ ` *$height* `_ `, `_ ` *$latitude* `_ `, `_ ` *$longitude* `_ `, `_ ` *$zoom\_level* `_ `, and `_ ` *$map\_type* `_ `. They are kept in the `_ ` *function main* `_ `. For each variable line, use the following format: `_ .. ### BEGIN~OF~TABLE ### .. ###### END~OF~TABLE ###### `The predefined area in this file is ` _ .. ### BEGIN~OF~TABLE ### .. _: /\* """ .. container:: table-row a /\* $width = 400; $height = 400; $latitude = 48.1456; $longitude = 11.6156; $zoom\_level = 15; $map\_type = NORMAL; \*/ .. ###### END~OF~TABLE ###### `You must uncomment it and adapt the values of the variables. The default values are for a map centered at `_ ` *netcos AG* `_ `in Munich, Germany. You definitely will use different values for your purpose. `_ `The names of the variables and the types of their content are equal to the TypoScript configuration. So see section `_ ` *Configuration* `_ `for more details. `_ .. _Make-it-run: Make it run ^^^^^^^^^^^ To use this extension in a page you have to add its plugin when creating a page in the module *Page* . You just choose this plugin for a page and the map is drawn with the values you entered in your configuration. For that, your URL and the corresponding Google Map key must be alright. If the map is not drawn clear the cache in your TYPO3 installation and in your web browser. In many browsers, this can be done by CTRL-F5. If your map is still not drawn please check the TypoScript configuration and the setting of your Google map key.