PHPUG - Geo Maps for papaya CMS

41

Click here to load reader

description

PHPUG - Geo Maps For papaya CMS - 2009-05-06 >>>> Downloads: - papaya CMS mit Patches http://goo.gl/NYtrH - Geo Maps http://goo.gl/JOFge - papaya CMS manual http://goo.gl/mz4Ry

Transcript of PHPUG - Geo Maps for papaya CMS

Page 1: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 1

Geo Maps For papaya CMS

Page 2: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 2

Agenda

1. Google & Yahoo Maps

2. More Interfaces

3. Geo Maps

4. Geo Maps Modules

5. Sources And Links

Page 3: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 3

1. Google & Yahoo Maps

Page 4: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 4

1.1. Google Maps

8th february, 2005Default view

April 2005Satellite view

22th july, 2005Hybrid view

2nd january, 2006Route maps

Page 5: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 5

1.1.1. Google Maps Overview

Page 6: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 6

1.1.2. More Google Maps Types

Satellite Hybrid Physical

Mars Mars (Elevation) Mars (Infrared)

Moon Mond (Elevation) Stars / Sky

Page 7: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 7

1.1.3. Google Maps API

June 2005: Version 1

3rd april, 2006: Version 2

11th june, 2006:Geocoder

New features a.o.Faster download

Own map overlaysMemory optimization

Free service with keyJavascript / XMLOwn data / points

without advertisements (so far)*

Parser for addressesand coordinates calculation

* Alternative: Google Maps API Premier (controllable advertisments)

Page 8: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 8

1.1.4. Google Geocoder

Address input

Single stringNo formatting specifications

Supports abbreviations

Address splitted in componentseXtensible Address Language

Supports 200+ countries

Address output

Coordinates(Latitude / Longitude)

Simple Geocoder

Client-side cacheless Geocoder-requests

More performance

Up to 50.000 Requests per API key / day

HTTP / JavaScriptrequest

JavaScript request: GclientGeocoder()

Page 9: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 9

1.2. Yahoo Maps

Free service with application IDsince 03.11.2005 (Beta release)

Page 10: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 10

1.2.1. Yahoo Maps API

First version in summer 2005(released with

Google Maps API)

for USA only(at the beginning)

with Geocoder

Flash / Ajax

Page 11: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 11

2. More Interfaces

Open Layers

Page 12: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 12

2.1. Google Earth

Virtual 3D globe

Different map layers

Interchange format KML

Basic version for free

Windows, Mac OS X, Linux, SymbianOS, iPhone OS

Page 13: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 13

2.2. Open Layers

Open Layers

Open Geospatial Consortium (2008)

Open map layers (standardized formats)

Closed formats(Microsoft, Google, Yahoo)

Page 14: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 14

2.2.1. Open Layers Example 1

Draw functions

Page 15: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 15

2.2.2. Open Layers Example 2

GeoRSS with Flickr imagesvar newl = new OpenLayers.Layer.GeoRSS('georss.xml');map.addLayer(newl);

Page 16: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 16

2.2.2.1. GeoRSS Example

GeoRSS according to W3C standard

Page 17: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 17

2.2.3. Open Street Map

Collection of free usable geo dataWiki-like database with edit functionsCreative Commons Share-Alike 2.0

Page 18: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 18

3. Geo Maps

papaya CMS (RC1 and nightly)

Developement since mai 2007

Google Maps / Yahoo Maps integration

Markers and keys management

Page 19: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 19

3.1. API Functions In Geo Maps

- (De-)Activate / configure map controls

- Set map type / size and zoom level

- Arange / center map

- Descriptions by using mouse-events

- Lines (Polyline)

- Static maps

- Get map coordinates by click OnClick-Event / Description

Page 20: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 20

3.1.1. More Examples

Get map coordinates to set them into a input field. Set polygon lines

Page 21: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 21

4. Geo Maps Modules

Geo Maps modules overview in the papaya CMS backend

Page 22: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 22

4.1. Administration

Markers management

Keys / application IDs management

Page 23: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 23

4.1.1. Manage Markers

Page 24: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 24

4.1.2. Manage Keys / Application IDs

Manage Google API keys and / or Yahoo application IDs

Page 25: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 25

4.2. Map Boxes

Google Maps Box Yahoo Maps Box

Output class

Base class

Configuration

Get data from configuration (setter)

Link-URLs and XML-output (getter)

Page 26: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 26

4.2.1. - Configure Map Boxes

Settings / options for map presentation

Page 27: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 27

4.2.2. - Configure Map Boxes

Markers data / markers settings

Page 28: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 28

4.2.3. - Configure Map Boxes

More configuration possibilities

Page 29: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 29

4.2.4. Dynamic And Static Map

Dynamic with control element Static map image

Static map request ->

URL maps.google.com/staticmap

Paramter- center = LAT,LNG- zoom = 15- size = 212x212- maptype = roadmap- markers = LAT,LNG,red- key = API-KEY

Page 30: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 30

4.2.4.1. Dynamic Map Request (1)

1. Check browser compatibility:GBrowserIsCompatible() -> TRUE / FALSE

2. Get div-element from document:var mapElement = document.getElementById("map");

3. Get map object with map size setting:var googleMap = new Gmap2( mapElement, {'size' : new GSize(width, height)});

4. Set a valid map type:googleMaps.setMapType(mapTypeConstant);

Load API Java Script with API-key

Page 31: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 31

4.2.4.1. Dynamic Map Request (2)

5. Add a control element:googleMap.addControl(new GLargeMapControl());

6. Get a point coordinate object:var point = new GLatLng(

parseFloat(latitude), parseFloat(longitude));

7. Center map:googleMaps.setCenter(point);

8. Set markers:var marker = new GMarker(point);

(more parameters for own icon images available)googleMaps.addOverlay(marker);

Page 32: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 32

4.3. - Connector

Methods:

Folders list as combo selection box

Add marker

Delete marker

Base class Class of external moduleConnector class

Page 33: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 33

4.3.1. - Connector Example

Map- and special box

Click-Event function (overloaded)

M2

M1

Geo Maps connector

Geo Maps base class

Geo Maps output class

function coorModeAction(x, y) { if (lastMarker != null) googleMaps.removeOverlay(lastMarker); lastMarker = setMarker(new GLatLng(y, x)); locationInput.value = y+','+x; }

Page 34: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 34

4.4. Geo Maps Database Tables

Page 35: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 35

4.4.1. Markers Data Output

KML

Descriptionin HTML

XMLHttpRequest

Styles forGoogle Earth

Page 36: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 36

4.4.1.1. Export Markers Data

Export function inbackend

Download by using a KML output mode(markers data page)

KML contains styles to get a marker icon

Page 37: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 37

4.5. MySQL Spatial Extensions

Functions:Creation, storage and analysis of

geographic characteristics

Since MySQL 4.1 (for MyISAM)

Since 5.0.16 for InnoDB, NDB, BDB and ARCHIVE too

Page 38: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 38

4.5.1. SE Class Hierarchy

Point: 0-dimensionalCurve: 1-dimensional

Surface: 2-dimensional

GeometryCollection:Collection of

different geometries

Page 39: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 39

4.5.2. Geo Maps Functions For SE

- Create database table(for points and polygons)

- Add / remove points

- Add / remove polygons

- Get nearest point

- Is point a within polygon x?

Base class for Spatial Extensions

Column type: polygonIndex: SPATIAL KEY

Column type: pointIndex: SPATIAL KEY

Page 40: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 40

4.5.3. SE Database Tables

Extension tables for MySQL Spatial Extensions or rather polygon- and point-data.

Page 41: PHPUG - Geo Maps for papaya CMS

05.06.09 Geo Maps - Martin Kelm 41

5. Sources And Further Links

martinkelm.deen.wikipedia.org/wiki/Google_Mapsen.wikipedia.org/wiki/Google_Earthen.wikipedia.org/wiki/Yahoo_Mapsen.wikipedia.org/wiki/Open_Layersopenlayers.org/dev/exampleswww.georss.org/Main_Pagedev.mysql.com/doc/refman/5.0/en/spatial-extensions.htmlcode.google.com/apis/maps/documentation/reference.htmldeveloper.yahoo.com/maps/ajax/V2/reference.htmlshrt.ws / weisse-liste.de

ENDE