Subversion Repositories googlemaps

[/] [trunk/] [extension/] [gmaplocation/] [README.txt] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1 joekepley
gmapsLocation Datatype Extension
2 4 Cyberwolf
Version 0.5
3 1 joekepley
Developed by Blend Interactive
4
http://blendinteractive.com
5
----------------------
6 4 Cyberwolf
The GmapsLocation datatype extension provides a handy way to store
7 1 joekepley
latitude/longitude points on an object by using Google Maps to identify
8
and mark positions using their address.
9
 
10
Installation
11
---------------
12
 
13 4 Cyberwolf
1.) Obtain a Google Maps Key for all domains you'll be using by registering
14 1 joekepley
your domains with Google at http://www.google.com/apis/maps/
15
 
16 4 Cyberwolf
2.) Upload the gmapslocation folder to the extensions folder in your
17 1 joekepley
eZ Publish installation.
18
 
19 4 Cyberwolf
3.) Activate the extension from the 'Extensions' portion of the
20 1 joekepley
'Setup' tab in the eZ publish admin interface.
21
 
22 4 Cyberwolf
4.) Add your GmapsKey to the site.ini under [SiteSettings] like so:
23 1 joekepley
GMapsKey=<Long string of characters from Google>
24
 
25
Use
26
---------------
27 4 Cyberwolf
To use the extension, add the 'GMaps Location' datatype to your classes using
28 1 joekepley
the class editor.
29
 
30
The most common use of the extension is to also Google Maps data on a public-
31 4 Cyberwolf
facing web site. The included gmap.tpl template will provide a basic gmap
32
with mapped points. See the instructions in design/standard/templates/gmap.tpl
33
for the full documentation of parameters.
34 1 joekepley
 
35 4 Cyberwolf
A few examples:
36 1 joekepley
 
37 4 Cyberwolf
List all office objects under node 57 and display their 'location'
38 1 joekepley
attributes on a 600x400 map. Also list the offices on the page:
39
 
40
{def $offices = fetch('content','list', hash(
41
                'parent_node_id', 57,
42
                'class_filter_type', 'include',
43
                'class_filter_array', array('office')))}
44
 
45 4 Cyberwolf
{include uri='design:gmaps.tpl'
46 1 joekepley
    locations=$offices
47
    size=array(600,400)
48
    show_popups_on_page=true()
49
}
50
 
51
 
52 4 Cyberwolf
Recursively get all image objects under node 243 and display their
53 1 joekepley
'gps_point' attributes on a 400x400 map. Center the map on Yellowstone
54
National Park at a reasonable zoom level, and use the object's 'galleryline'
55
view for the map popups:
56
 
57
{def $pictures = fetch('content','tree', hash(
58
                'parent_node_id', 243,
59
                'class_filter_type', 'include',
60
                'class_filter_array', array('image')))}
61
 
62 4 Cyberwolf
{include uri='design:gmaps.tpl'
63 1 joekepley
    locations=$pictures
64
    location_attribute='gps_point'
65
    center=array(44.62566, -110.5389)
66
    zoom=8
67
    popup_view='galleryline'
68
}
69
 
70
 
71 4 Cyberwolf
Pull the 'location' attribute from the object at node 415, and display a
72 1 joekepley
small map centered on that point. Don't display any markers.
73
{def $center = fetch('content','node', hash(
74
                'node_id', 415))}
75
 
76 4 Cyberwolf
 
77
{include uri='design:gmaps.tpl'
78 1 joekepley
    center=$center.object.data_map.location.content
79
    zoom=8
80
    size=array(150,150)
81
}
82
 
83
 
84 4 Cyberwolf
 
85 1 joekepley
See the samples folder for samples of customized maps.
86
 
87