-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
459 lines (425 loc) · 17 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" class="no-js">
<head>
<title>Drupal OpenLayers Presentation (DrupalCon Copenhagen 2010)</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<link href="styles/presentation.css" type="text/css" rel="stylesheet" media="Screen,projection" />
<link href="js/syntaxhighlighter/styles/shCore.css" rel="stylesheet" type="text/css" />
<link href="js/syntaxhighlighter/styles/shCoreDefault.css" rel="stylesheet" type="text/css" />
<link href="js/syntaxhighlighter/styles/shThemeDefault.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
<div class="container">
<h1>Mapping in Drupal with OpenLayers</h1>
</div>
</div>
<div id="content">
<div id="slides">
<!-- Alan -->
<!-- Not advancded, for beginners. -->
<!-- Who has the module before? -->
<!-- Who has done web mapping stuff before? -->
<!-- Who has used GMap before? -->
<!-- Who has come from a GIS? -->
<div class="slide title-page alan">
<h2>Mapping in Drupal with OpenLayers</h2>
<h3>Making your data more tangible.</h3>
<p class="authors">by Alan Palazzolo and Thomas Turnbull</p>
</div>
<!-- Thomas -->
<div class="slide">
<div class="demo-links">
<span class="thomas">t</span>
</div>
<h2>Why Map?</h2>
<ul>
<li>Maps provide a unique perspective.</li>
<li>Users are familiar with it. (i.e. Google Maps)</li>
<li>Drupal is a great vehicle for data.</li>
</ul>
</div>
<!-- Thomas -->
<div class="slide">
<div class="demo-links">
<span class="thomas">t</span>
<a title="View Example Map" href="../ol_dccph2010_demo/map/example_full">Map</a>
</div>
<h2>What is OpenLayers?</h2>
<ul>
<li>Open-source, third-party, Javascript library.</li>
<li>Interface to view map data.</li>
<li><a href="http://openlayers.org/">openlayers.org</a></li>
<li>Project of OSGeo.</li>
</ul>
</div>
<!-- Thomas -->
<div class="slide">
<h2>Where is this?</h2>
<img src="images/googlemapsapi.png" />
</div>
<!-- Thomas -->
<div class="slide">
<h2>Tel Aviv on maps.google.com</h2>
<img src="images/googlecom.png" />
</div>
<!-- Thomas -->
<div class="slide">
<h2>Tel Aviv on Open Street Map</h2>
<img src="images/osm.png" />
</div>
<!-- Thomas -->
<div class="slide">
<div class="demo-links">
<span class="thomas">t</span>
</div>
<h2>Drupal and OpenLayers</h2>
<ul>
<li>Provides integration between Drupal data and OpenLayers maps.</li>
<li>Integrated with CCK, Views, Filters.</li>
<li>Utilizes CTools plugin architecture and provides exportables.</li>
<li><a href="http://drupal.org/project/openlayers">drupal.org/project/openlayers</a></li>
</ul>
</div>
<!-- Alan -->
<div class="slide">
<div class="demo-links">
<span class="alan">a</span>
<a title="View Basic Map" href="../ol_dccph2010_demo/map/basic">Map</a>
<a title="Edit Basic Map" href="../ol_dccph2010_demo/admin/build/openlayers/presets/ol_demo_map_basic/edit">Preset</a>
</div>
<h2>Maps (aka Presets)</h2>
<ul>
<li>Collections of settings that define a map.</li>
<li>Basic configuration such as images and CSS.</li>
<li>Layers to include, such as OpenStreetMap tiles or KML feed.</li>
<li>Styles to define how features will display.</li>
<li>Behaviors to use, such as popups or fullscreen.</li>
</ul>
</div>
<!-- Alan -->
<div class="slide">
<div class="demo-links">
<span class="alan">a</span>
<a title="View GeoRSS Map" href="../ol_dccph2010_demo/map/georss">Map</a>
<a title="View GeoRSS Preset" href="../ol_dccph2010_demo/admin/build/openlayers/presets/ol_demo_georss_example/edit">Preset</a>
<a title="Edit GeoRSS Layer" href="../ol_dccph2010_demo/admin/build/openlayers/layers/ol_demo_georss_dccph_example/edit">Layer</a>
</div>
<h2>Layers</h2>
<ul>
<li>Sets of data to overlay on the map.</li>
<li>Tile sets like OpenStreetMap or Google.</li>
<li>Vector data created from Views.</li>
<li>External feeds like KML.</li>
</ul>
</div>
<!-- Alan -->
<div class="slide">
<div class="demo-links">
<span class="alan">a</span>
<a title="View Airport Node" href="../ol_dccph2010_demo/content/copenhagen-airport-cph">View</a>
<a title="Edit Airport Node Preset" href="../ol_dccph2010_demo/admin/build/openlayers/presets/ol_demo_map_input_display_airport/edit">Preset</a>
<a title="Edit Airport Style" href="../ol_dccph2010_demo/admin/build/openlayers/styles/ol_demo_style_airport/edit">Style</a>
</div>
<h2>Styles</h2>
<ul>
<li>Define how features will display.</li>
<li>Icon images.</li>
<li>Colors and radius.</li>
<li>and more.</li>
</ul>
</div>
<!-- Alan -->
<div class="slide">
<div class="demo-links">
<span class="alan">a</span>
<a title="View Airport Node" href="../ol_dccph2010_demo/map/behaviors">Map</a>
<a title="Edit Behaviors Preset" href="../ol_dccph2010_demo/admin/build/openlayers/presets/ol_demo_map_behaviors/edit">Preset</a>
</div>
<h2>Behaviors</h2>
<ul>
<li>Interactive enhancements to add to a map.</li>
<li>Popups for features/markers.</li>
<li>Toggle fullscreen view of the map.</li>
<li>Draw points on a map.</li>
<li>and more!</li>
</ul>
</div>
<!-- Thomas -->
<div class="slide">
<div class="demo-links">
<span class="thomas">t</span>
<a title="Add POI Node" href="../ol_dccph2010_demo/node/add/ol-demo-poi">Add</a>
<a title="Edit Location Field" href="../ol_dccph2010_demo/admin/content/node-type/ol-demo-poi/fields/field_ol_demo_location">Field</a>
</div>
<h2>CCK Input</h2>
<ul>
<li>Input points, lines, and polygons on a map.</li>
<li>Stored as WKT (Well-known text).</li>
<li>Basic, but not robust.</li>
</ul>
</div>
<!-- Thomas -->
<div class="slide">
<div class="demo-links">
<span class="thomas">t</span>
<a title="View Data Overlay Map" href="../ol_dccph2010_demo/map/data_overlays">Map</a>
<a title="Edit Data Overlay Preset" href="../ol_dccph2010_demo/admin/build/openlayers/presets/ol_demo_map_data_overlays/edit">Preset</a>
<a title="Edit Data Overlay Views" href="../ol_dccph2010_demo/admin/build/views/edit/ol_demo_data_overlays">View</a>
</div>
<h2>Views (Data Overlays)</h2>
<ul>
<li>Data handling of lat/lon, WKT, or bounding box.</li>
<li>Leverage the power of Views (filtering, arguments, etc).</li>
<li>Multiple data overlays on single map.</li>
</ul>
</div>
<!-- Thomas -->
<div class="slide">
<div class="demo-links">
<span class="thomas">t</span>
<a title="Edit Data Overlay Views" href="../ol_dccph2010_demo/admin/build/views/edit/ol_demo_map_displays">View</a>
<a title="Show a Map" href="../ol_dccph2010_demo/map/data_overlays">Map</a>
</div>
<h2>Views (Map Displays)</h2>
<ul>
<li>Leverage Views displaying methods.</li>
</ul>
</div>
<!-- Alan -->
<div class="slide">
<div class="demo-links">
<span class="alan">a</span>
</div>
<h2>Architecture</h2>
<ul>
<li>Leveraging CTools plugin architecture.</li>
<li>Exportable paradigm (like Views and Panels).</li>
<li>Automatic Features support.</li>
<li>Limit custom Javascript.</li>
<li>Handbook pages and API docs in module.</li>
</ul>
</div>
<!-- Alan -->
<div class="slide">
<div class="demo-links">
<span class="alan">a</span>
</div>
<h2>Map Presets</h2>
<pre class="brush: php">
$map = new stdClass();
$map->api_version = 1;
$map->name = 'example';
$map->title = t('Example Map');
$map->description = t('Description ...');
$map->data = array(
'projection' => '900913',
'width' => 'auto',
'height' => '400px',
'default_layer' => 'osm_mapnik',
'center' => array(
'initial' => array(
'centerpoint' => '0,0',
'zoom' => '2'
)
),
'displayProjection' => '4326',
'maxExtent' => openlayers_get_extent('4326'),
'behaviors' => array(
'openlayers_behavior_panzoombar' => array(),
'openlayers_behavior_layerswitcher' => array(),
'openlayers_behavior_attribution' => array(),
'openlayers_behavior_keyboarddefaults' => array(),
'openlayers_behavior_navigation' => array(),
),
'layers' => array(
'osm_mapnik' => 'osm_mapnik',
)
);
</pre>
</div>
<!-- Alan -->
<div class="slide">
<div class="demo-links">
<span class="alan">a</span>
</div>
<h2>Layer Types (plugin)</h2>
<pre class="brush: php">
class openlayers_layer_type_example extends openlayers_layer_type {
function __construct($layer = array(), $map = array()) {
parent::__construct($layer, $map);
$this->data += $this->options_init();
}
function options_init() {
// Array of options
}
function options_form() {
// Form array for options
}
function render(&$map) {
drupal_add_js(drupal_get_path('module', 'openlayers')
. '/includes/layer_types/js/example.js');
return $this->options;
}
}
</pre>
</div>
<!-- Alan -->
<div class="slide">
<div class="demo-links">
<span class="alan">a</span>
</div>
<h2>Layer Types (Javascript)</h2>
<pre class="brush: js; highlight: [7]">
Drupal.openlayers.layer.example = function(title, map, options) {
var styleMap = Drupal.openlayers.getStyleMap(map, options.drupalID);
if (options.maxExtent !== undefined) {
options.maxExtent = new OpenLayers.Bounds.fromArray(options.maxExtent);
}
options.projection = 'EPSG:' + options.projection;
var layer = new OpenLayers.Layer.OSM(title, options.base_url, options);
layer.styleMap = styleMap;
return layer;
};
</pre>
</div>
<!-- Alan -->
<div class="slide">
<div class="demo-links">
<span class="alan">a</span>
</div>
<h2>Behaviors (Plugin)</h2>
<pre class="brush: php; highlight: [21]">
class openlayers_behavior_fullscreen extends openlayers_behavior {
function options_init() {
return array(
'activated' => FALSE
);
}
function options_form($defaults) {
return array(
'activated' => array(
'#title' => t('Initially activated'),
'#type' => 'checkbox',
'#description' => t('Select to be in fullscreen by default.'),
'#default_value' => isset($defaults['activated']) ? $defaults['activated'] : FALSE
)
);
}
function render(&$map) {
drupal_add_css(drupal_get_path('module', 'openlayers') . '/includes/behaviors/js/openlayers_behavior_fullscreen.css');
drupal_add_js(drupal_get_path('module', 'openlayers') . '/includes/behaviors/js/openlayers_behavior_fullscreen.js');
return $this->options;
}
}
</pre>
</div>
<!-- Alan -->
<div class="slide">
<div class="demo-links">
<span class="alan">a</span>
</div>
<h2>Behaviors (Javascript)</h2>
<pre class="brush: js; highlight: [1]">
Drupal.behaviors.openlayers_behavior_fullscreen = function(context) {
var fullscreenPanel;
var data = $(context).data('openlayers');
if (data && data.map.behaviors['openlayers_behavior_fullscreen']) {
var opts = data.map.behaviors['openlayers_behavior_fullscreen'];
// Create new panel control and add.
fullscreenPanel = new OpenLayers.Control.Panel(
{
displayClass: 'openlayers_behavior_fullscreen_button_panel'
}
);
data.openlayers.addControl(fullscreenPanel);
}
}
</pre>
</div>
<!-- Thomas -->
<div class="slide">
<div class="demo-links">
<span class="thomas">t</span>
<a title="OpenLayers Geocoder" href="../ol_dccph2010_demo/node/add/geocoder-example">OG</a>
<a title="GeoTaxonomy" href="../ol_dccph2010_demo/admin/content/taxonomy/edit/term/1">GT</a>
</div>
<h2>Related Modules</h2>
<ul>
<li>GeoTaxonomy</li>
<li>OpenLayers Geocoder</li>
<li>OpenLayers Proximity</li>
<li>Mapbox</li>
</ul>
</div>
<!-- Alan -->
<div class="slide">
<div class="demo-links">
<span class="alan">a</span>
</div>
<h2>Roadmap</h2>
<ul>
<li>Still alpha.</li>
<li>Only a few issues until beta.</li>
<li>Once beta, just stabilize.</li>
</ul>
</div>
<!-- Alan -->
<div class="slide">
<div class="demo-links">
<span class="alan">a</span>
</div>
<h2>How You Can Help</h2>
<ul>
<li>Testing.</li>
<li>Patches.</li>
<li>Comments.</li>
</ul>
</div>
<!-- Alan -->
<div class="slide">
<div class="demo-links">
<span class="alan">a</span>
</div>
<h2>Credits</h2>
<ul>
<li>Developers: <a href="http://drupal.org/user/147331">zzolo</a>, <a href="http://drupal.org/user/12664">tmcw</a>, <a href="http://drupal.org/user/47098">phayes</a>, <a href="http://drupal.org/user/781486">strk</a>, and more</li>
<li>Presentation by: <a href="http://drupal.org/user/147331">zzolo</a> and <a href="http://drupal.org/user/125573">tom_o_t</a></li>
<li>OpenLayers Monster by <a href="http://www.flickr.com/photos/samanpwbb/">Saman Bemel Benrud</a></li>
<li>Technology used: <a href="">jQuery</a>, <a href=" http://github.com/davist11/jQuery-Presentation">jQuery Presentation</a>, <a href="http://alexgorbatchev.com/SyntaxHighlighter/">SyntaxHighlighter</a>, and <a href="http://github.com/malsup/corner">Corner</a></li>
<li><a href="http://github.com/zzolo/openlayers-presentation-dccph2010">Presentation source</a> and <a href="http://github.com/zzolo/ol_dccph2010_demo">demo files</a> on GitHub</li>
</ul>
</div>
<!-- Alan -->
<div class="slide">
<div class="demo-links">
<span class="alan">a</span>
<a title="Survey" href="outro.html">Survey</a>
</div>
<h2>Geo-Stuff BoF</h2>
<ul>
<li>Drupal and Place.</li>
<li>Talk all about geo-related things and Drupal.</li>
<li><strong>Today</strong> (25 Aug) at <strong>16:00</strong> in BoF Space 4.</li>
</ul>
</div>
</div>
<div id="footer">
<div class="container">
2010 Alan Palazzolo and Thomas Turnbull
</div>
</div>
<script type="text/javascript" src="js/jquery.js"></script>
<!-- Presentation script: http://github.com/davist11/jQuery-Presentation -->
<script type="text/javascript" src="js/jquery.presentation.js"></script>
<script type="text/javascript" src="js/presentation.js"></script>
<!-- jQuery rounded corner plugin: http://www.malsup.com/jquery/corner/ -->
<script type="text/javascript" src="js/jquery.corner.js"></script>
<script type="text/javascript" src="js/rounded.js"></script>
<!-- Code highlighter: http://alexgorbatchev.com/SyntaxHighlighter/ -->
<script type="text/javascript" src="js/syntaxhighlighter/scripts/shCore.js"></script>
<script type="text/javascript" src="js/syntaxhighlighter/scripts/shAutoloader.js"></script>
<script type="text/javascript" src="js/syntax.js"></script>
</body>
</html>