forked from karlbenedict/GEOG485-585
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lecture03_Mod02_a_02_a.md.html
821 lines (821 loc) · 99.3 KB
/
lecture03_Mod02_a_02_a.md.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
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<meta name="author" content="Karl Benedict" />
<title>Geography 485L/585L - Internet Mapping</title>
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
<style type="text/css">
a.sourceLine { display: inline-block; line-height: 1.25; }
a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; }
a.sourceLine:empty { height: 1.2em; position: absolute; }
.sourceCode { overflow: visible; }
code.sourceCode { white-space: pre; position: relative; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
code.sourceCode { white-space: pre-wrap; }
a.sourceLine { text-indent: -1em; padding-left: 1em; }
}
pre.numberSource a.sourceLine
{ position: relative; }
pre.numberSource a.sourceLine:empty
{ position: absolute; }
pre.numberSource a.sourceLine::before
{ content: attr(data-line-number);
position: absolute; left: -5em; text-align: right; vertical-align: baseline;
border: none; pointer-events: all;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
a.sourceLine::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
</style>
<link rel="stylesheet" href="page.css">
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<header>
<h1 class="title">Geography 485L/585L - Internet Mapping</h1>
<p class="author">Karl Benedict</p>
<p class="date">Spring 2018</p>
</header>
<!---------------------------------------------------------------------------->
<!-- Week 03 ----------------------------------------------------------------->
<!-- Lecture 02 a 02 a ------------------------------------------------------->
<!-- Web-based Mapping Clients------------------------------------------------>
<!-- Google Maps API---------------------------------------------------------->
<!---------------------------------------------------------------------------->
<h1 id="week-3--module-2a---web-based-mapping-clients.-google-maps-api">Week 3- Module 2a - Web-based Mapping Clients. Google Maps API</h1>
<h3 id="outline" class="module02a02a">Outline</h3>
<ul>
<li><p>What is an API</p></li>
<li>The Google Maps API
<ul>
<li>Version</li>
<li>Reference Information</li>
<li>Key Components</li>
<li>Examples</li>
</ul></li>
</ul>
<h3 id="what-is-an-api" class="module02a02a">What is an API</h3>
<ul>
<li>API Stands for Application Programming Interface</li>
</ul>
<blockquote>
<p>An Application Programming Interface (API) is a particular set of rules and specifications that a software program can follow to access and make use of the services and resources provided by another particular software program that implements that API. It serves as an interface between different software programs and facilitates their interaction, similar to the way the user interface facilitates interaction between humans and computers. – From Wikipedia: <a href="http://en.wikipedia.org/wiki/Api" class="uri">http://en.wikipedia.org/wiki/Api</a></p>
</blockquote>
<ul>
<li>The Google Maps API provides an interface for interacting with Google’s mapping services from external web applications</li>
</ul>
<h3 id="google-maps-api-version" class="module02a02a">Google Maps API Version</h3>
<ul>
<li>The version of the Google Maps API used in this class is v3 of the Javascript API
<ul>
<li>Freely usable for free applications</li>
<li>Subject to Google’s Terms of Service</li>
<li>Google <a href="https://developers.google.com/maps/faq?hl=en#using-google-maps-apis">API key is now required</a></li>
</ul></li>
<li>Key capabilities in v3
<ul>
<li>Interactive maps based on Google’s mapping engine (contrast w. static maps API)</li>
<li>Optimized for desktop and mobile platforms and applications</li>
</ul></li>
</ul>
<h3 id="reference-information" class="module02a02a">Reference Information</h3>
<dl>
<dt>Google Maps API Family</dt>
<dd><a href="https://developers.google.com/maps/?csw=1">http://code.google.com/apis/maps/</a>
</dd>
<dt>Javascript API Home Page</dt>
<dd><a href="https://developers.google.com/maps/documentation/javascript/?csw=1" class="uri">https://developers.google.com/maps/documentation/javascript/?csw=1</a>
</dd>
<dt>Javascript API v3 Tutorial Page</dt>
<dd><a href="https://developers.google.com/maps/documentation/javascript/tutorial?csw=1">http://code.google.com/apis/maps/documentation/javascript/tutorial.html</a>
</dd>
</dl>
<h3 id="key-components" class="module02a02a">Key Components</h3>
<ul>
<li>Map <a href="https://developers.google.com/maps/documentation/javascript/reference?csw=1#MapOptions">object options</a></li>
</ul>
<dl>
<dt>Types (required)</dt>
<dd>ROADMAP
</dd>
<dd>SATELLITE
</dd>
<dd>HYBRID
</dd>
<dd>TERRAIN
</dd>
<dt>Latitude and Longitude (required)</dt>
<dd>specification of where the map should initially be centered
</dd>
<dt>Zoom Level (required)</dt>
<dd>0=global, higher values increasingly local. Limited by map type
</dd>
</dl>
<h3 id="controls" class="module02a02a">Controls</h3>
<ul>
<li>Available Controls (enabled through map options) <a href="https://developers.google.com/maps/documentation/javascript/controls?csw=1#DefaultUI">default controls</a>
<ul>
<li>Zoom Control</li>
<li>Scale Control</li>
<li>MapType Control</li>
<li>Street View Control</li>
<li>Rotate (for maps that contain 45-degree imagery)</li>
<li>Fullscreen Control</li>
</ul></li>
<li>Different control styles may be defined</li>
<li>Controls may be positioned <a href="https://developers.google.com/maps/documentation/javascript/controls?csw=1#ControlPositioning">positioning options</a></li>
<li>Custom controls may be defined and attached to fixed location in the map</li>
</ul>
<h3 id="overlays" class="module02a02a">Overlays</h3>
<p>Overlay Types <a href="https://developers.google.com/maps/documentation/javascript/overlays?csw=1">documentation</a></p>
<dl>
<dt>Marker</dt>
<dd>points depicted by specified or defined icons at locations within the map (<a href="https://developers.google.com/maps/documentation/javascript/markers">reference</a>)
</dd>
<dt>Polyline</dt>
<dd>linear features defined by multiple points with a defined style for the line (<a href="https://developers.google.com/maps/documentation/javascript/shapes">reference</a>)
</dd>
<dt>Polygon</dt>
<dd>closed features defined by multiple points. Supports multi-polygons, and donuts. Line and fill styles may be specified. (<a href="https://developers.google.com/maps/documentation/javascript/shapes">reference</a>)
</dd>
<dt>(Ground) Overlay Maps</dt>
<dd>Image-based map layers that replace or overlay Google layers - registered to the map coordinates (<a href="https://developers.google.com/maps/documentation/javascript/groundoverlays">reference</a>)
</dd>
<dt>Info Windows</dt>
<dd>floating content windows for displaying content defined as HTML, a DOM element, or text string (<a href="https://developers.google.com/maps/documentation/javascript/infowindows">reference</a>)
</dd>
<dt>Layers</dt>
<dd>Grouped display content assigned to a specific layer type: Data (including GeoJSON), KmlLayer (& GeoRSS), Heatmap, FusionTablesLayer, TrafficLayer, TransitLayer, BicyclingLayer (<a href="https://developers.google.com/maps/documentation/javascript/layers">reference</a>)
</dd>
<dt>Custom Overlays</dt>
<dd>definition of programmatically controlled layers (<a href="https://developers.google.com/maps/documentation/javascript/customoverlays">reference</a>)
</dd>
</dl>
<h3 id="services" class="module02a02a">Services</h3>
<ul>
<li>Geocoding Service
<ul>
<li>Forward and reverse geocoding:
<ul>
<li>address to LatLon</li>
<li>LatLon to Nearest Address</li>
</ul></li>
<li>May be biased to current viewport, region</li>
</ul></li>
<li>Directions
<ul>
<li>Based upon an origin, destination, and a variety of additional options</li>
<li>Available directions and rendered route</li>
</ul></li>
<li>Distance Matrix
<ul>
<li>Travel distance and duration given a specific mode of travel</li>
</ul></li>
<li>Elevation
<ul>
<li>Delivery of elevation data for locations or paths</li>
</ul></li>
<li>Streetview
<ul>
<li>Integration of Google Streetview within a DOM element</li>
</ul></li>
<li>Maximum Zoom
<ul>
<li>Provides information about the maximum available zoom level</li>
</ul></li>
</ul>
<h3 id="events" class="module02a02a">Events</h3>
<ul>
<li>Events provide the ability to attach custom behaviors to events in the interface. For example:
<ul>
<li>Changing items in the interface as the user zooms in on a map</li>
<li>Displaying additional information outside the map when the user clicks a location in the map</li>
<li>Synchronizing the behavior of multiple maps as the user interacts with one map</li>
</ul></li>
<li>Requires higher-level Javascript than we will cover in this course</li>
</ul>
<h3 id="examples" class="module02a02a">Examples</h3>
<h3 id="simple---roadmap" class="module02a02a">Simple - Roadmap</h3>
<p><img src="images/gmaps01.png" alt="gmaps01.html preview" /> </p>
<h3 id="simple---roadmap-code" class="module02a02a">Simple - Roadmap Code</h3>
<div class="codeTable">
<p><a href="http://karlbenedict.com/GEOG485-585/sample-files/GoogleMaps/gmaps01.html">gmaps01.html</a></p>
<div class="sourceCode" id="cb1"><pre class="sourceCode numberSource html numberLines"><code class="sourceCode html"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="dt"><!DOCTYPE </span>html<span class="dt">></span></a>
<a class="sourceLine" id="cb1-2" data-line-number="2"><span class="kw"><html></span></a>
<a class="sourceLine" id="cb1-3" data-line-number="3"> <span class="kw"><head></span></a>
<a class="sourceLine" id="cb1-4" data-line-number="4"> <span class="kw"><link</span><span class="ot"> rel=</span><span class="st">"stylesheet"</span><span class="ot"> type=</span><span class="st">"text/css"</span><span class="ot"> href=</span><span class="st">"css/mapPage.css"</span><span class="kw">></span></a>
<a class="sourceLine" id="cb1-5" data-line-number="5"> <span class="kw"></head></span></a>
<a class="sourceLine" id="cb1-6" data-line-number="6"></a>
<a class="sourceLine" id="cb1-7" data-line-number="7"> <span class="kw"><body></span></a>
<a class="sourceLine" id="cb1-8" data-line-number="8"> <span class="kw"><h1></span>Sample Map<span class="kw"></h1></span></a>
<a class="sourceLine" id="cb1-9" data-line-number="9"> <span class="kw"><div</span><span class="ot"> id=</span><span class="st">"map_canvas"</span><span class="kw">></div></span></a>
<a class="sourceLine" id="cb1-10" data-line-number="10"></a>
<a class="sourceLine" id="cb1-11" data-line-number="11"> <span class="co"><!-- Let's put our JavaScript down here </span><span class="er">-------------------------------------------</span><span class="co">--></span></a>
<a class="sourceLine" id="cb1-12" data-line-number="12"> <span class="co"><!-- Load the external JavaScript file with the map definition code --></span></a>
<a class="sourceLine" id="cb1-13" data-line-number="13"> <span class="kw"><script</span><span class="ot"> src=</span><span class="st">"js/mapPage_01.js"</span><span class="kw">></script></span></a>
<a class="sourceLine" id="cb1-14" data-line-number="14"> </a>
<a class="sourceLine" id="cb1-15" data-line-number="15"> <span class="co"><!-- Load the API in asynchronous mode and execute the initialize </span></a>
<a class="sourceLine" id="cb1-16" data-line-number="16"><span class="co"> function when done --></span></a>
<a class="sourceLine" id="cb1-17" data-line-number="17"> <span class="kw"><script</span><span class="ot"> async defer</span> </a>
<a class="sourceLine" id="cb1-18" data-line-number="18"><span class="ot"> src=</span><span class="st">"https://maps.googleapis.com/maps/api/js?callback=initialize</span><span class="er">&</span><span class="st">key=</span><span class="er"><</span><span class="st">mykey>"</span><span class="kw">></span></a>
<a class="sourceLine" id="cb1-19" data-line-number="19"> <span class="kw"></script></span></a>
<a class="sourceLine" id="cb1-20" data-line-number="20"> <span class="kw"></body></span></a>
<a class="sourceLine" id="cb1-21" data-line-number="21"><span class="kw"></html></span></a></code></pre></div>
<p><a href="http://karlbenedict.com/GEOG485-585/sample-files/GoogleMaps/css/mapPage.css">mapPage.css</a></p>
<div class="sourceCode" id="cb2"><pre class="sourceCode numberSource css numberLines"><code class="sourceCode css"><a class="sourceLine" id="cb2-1" data-line-number="1"><span class="co">/* You must set the height of either the 'html' or 'body' elements for some </span></a>
<a class="sourceLine" id="cb2-2" data-line-number="2"><span class="co"> browsers to properly render the map with a hight taller than 0px */</span></a>
<a class="sourceLine" id="cb2-3" data-line-number="3">html { </a>
<a class="sourceLine" id="cb2-4" data-line-number="4"> <span class="kw">height</span>: <span class="dv">100%</span> }</a>
<a class="sourceLine" id="cb2-5" data-line-number="5"></a>
<a class="sourceLine" id="cb2-6" data-line-number="6">body { </a>
<a class="sourceLine" id="cb2-7" data-line-number="7"> <span class="kw">height</span>: <span class="dv">100%</span>; </a>
<a class="sourceLine" id="cb2-8" data-line-number="8"> <span class="kw">margin</span>: <span class="dv">0px</span>; </a>
<a class="sourceLine" id="cb2-9" data-line-number="9"> <span class="kw">padding</span>: <span class="dv">0px</span>; </a>
<a class="sourceLine" id="cb2-10" data-line-number="10"> <span class="kw">background-color</span>: <span class="dv">black</span>; </a>
<a class="sourceLine" id="cb2-11" data-line-number="11"> <span class="kw">color</span>: <span class="dv">#CCCCCC</span>;</a>
<a class="sourceLine" id="cb2-12" data-line-number="12"> <span class="kw">text-align</span>: <span class="dv">center</span>}</a>
<a class="sourceLine" id="cb2-13" data-line-number="13"> </a>
<a class="sourceLine" id="cb2-14" data-line-number="14"><span class="pp">#map_canvas</span> { </a>
<a class="sourceLine" id="cb2-15" data-line-number="15"> <span class="kw">width</span>:<span class="dv">90%</span>; </a>
<a class="sourceLine" id="cb2-16" data-line-number="16"> <span class="kw">height</span>:<span class="dv">80%</span>; </a>
<a class="sourceLine" id="cb2-17" data-line-number="17"> <span class="kw">margin-left</span>:<span class="dv">auto</span>; </a>
<a class="sourceLine" id="cb2-18" data-line-number="18"> <span class="kw">margin-right</span>: <span class="dv">auto</span> }</a>
<a class="sourceLine" id="cb2-19" data-line-number="19"> </a>
<a class="sourceLine" id="cb2-20" data-line-number="20"><span class="fu">.infoBox</span> { </a>
<a class="sourceLine" id="cb2-21" data-line-number="21"> <span class="kw">color</span>:<span class="dv">black</span> }</a></code></pre></div>
<p><a href="http://karlbenedict.com/GEOG485-585/sample-files/GoogleMaps/js/mapPage_01.js">mapPage_01.js</a></p>
<div class="sourceCode" id="cb3"><pre class="sourceCode numberSource js numberLines"><code class="sourceCode javascript"><a class="sourceLine" id="cb3-1" data-line-number="1"><span class="kw">function</span> <span class="at">initialize</span>() <span class="op">{</span></a>
<a class="sourceLine" id="cb3-2" data-line-number="2"> <span class="kw">var</span> classroom <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084280</span><span class="op">,-</span><span class="fl">106.624073</span>)</a>
<a class="sourceLine" id="cb3-3" data-line-number="3"> <span class="kw">var</span> mapOptions <span class="op">=</span> <span class="op">{</span></a>
<a class="sourceLine" id="cb3-4" data-line-number="4"> <span class="dt">zoom</span><span class="op">:</span> <span class="dv">8</span><span class="op">,</span></a>
<a class="sourceLine" id="cb3-5" data-line-number="5"> <span class="dt">center</span><span class="op">:</span> classroom<span class="op">,</span></a>
<a class="sourceLine" id="cb3-6" data-line-number="6"> <span class="dt">mapTypeId</span><span class="op">:</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="va">MapTypeId</span>.<span class="at">ROADMAP</span></a>
<a class="sourceLine" id="cb3-7" data-line-number="7"> <span class="op">};</span></a>
<a class="sourceLine" id="cb3-8" data-line-number="8"> <span class="kw">var</span> map <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">Map</span>(</a>
<a class="sourceLine" id="cb3-9" data-line-number="9"> <span class="va">document</span>.<span class="at">getElementById</span>(<span class="st">"map_canvas"</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb3-10" data-line-number="10"> mapOptions)<span class="op">;</span></a>
<a class="sourceLine" id="cb3-11" data-line-number="11"><span class="op">}</span></a>
<a class="sourceLine" id="cb3-12" data-line-number="12"></a></code></pre></div>
</div>
<h3 id="simple---satellite" class="module02a02a">Simple - Satellite</h3>
<p><img src="images/gmaps02.png" alt="gmaps02.html preview" /> </p>
<h3 id="simple---satellite-code" class="module02a02a">Simple - Satellite Code</h3>
<div class="codeTable">
<p><a href="http://karlbenedict.com/GEOG485-585/sample-files/GoogleMaps/gmaps02.html">gmaps02.html</a></p>
<div class="sourceCode" id="cb4"><pre class="sourceCode numberSource html numberLines"><code class="sourceCode html"><a class="sourceLine" id="cb4-1" data-line-number="1"><span class="dt"><!DOCTYPE </span>html<span class="dt">></span></a>
<a class="sourceLine" id="cb4-2" data-line-number="2"><span class="kw"><html></span></a>
<a class="sourceLine" id="cb4-3" data-line-number="3"> <span class="kw"><head></span></a>
<a class="sourceLine" id="cb4-4" data-line-number="4"> <span class="kw"><link</span><span class="ot"> rel=</span><span class="st">"stylesheet"</span><span class="ot"> type=</span><span class="st">"text/css"</span><span class="ot"> href=</span><span class="st">"css/mapPage.css"</span><span class="kw">></span></a>
<a class="sourceLine" id="cb4-5" data-line-number="5"> <span class="kw"></head></span></a>
<a class="sourceLine" id="cb4-6" data-line-number="6"></a>
<a class="sourceLine" id="cb4-7" data-line-number="7"> <span class="kw"><body></span></a>
<a class="sourceLine" id="cb4-8" data-line-number="8"> <span class="kw"><h1></span>Sample Map<span class="kw"></h1></span></a>
<a class="sourceLine" id="cb4-9" data-line-number="9"> <span class="kw"><div</span><span class="ot"> id=</span><span class="st">"map_canvas"</span><span class="kw">></div></span></a>
<a class="sourceLine" id="cb4-10" data-line-number="10"></a>
<a class="sourceLine" id="cb4-11" data-line-number="11"> <span class="co"><!-- Let's put our JavaScript down here </span><span class="er">-------------------------------------------</span><span class="co">--></span></a>
<a class="sourceLine" id="cb4-12" data-line-number="12"> <span class="co"><!-- Load the external JavaScript file with the map definition code --></span></a>
<a class="sourceLine" id="cb4-13" data-line-number="13"> <span class="kw"><script</span><span class="ot"> src=</span><span class="st">"js/mapPage_02.js"</span><span class="kw">></script></span></a>
<a class="sourceLine" id="cb4-14" data-line-number="14"> </a>
<a class="sourceLine" id="cb4-15" data-line-number="15"> <span class="co"><!-- Load the API in asynchronous mode and execute the initialize </span></a>
<a class="sourceLine" id="cb4-16" data-line-number="16"><span class="co"> function when done --></span></a>
<a class="sourceLine" id="cb4-17" data-line-number="17"> </a>
<a class="sourceLine" id="cb4-18" data-line-number="18"> <span class="kw"><script</span><span class="ot"> async defer</span> </a>
<a class="sourceLine" id="cb4-19" data-line-number="19"><span class="ot"> src=</span><span class="st">"https://maps.googleapis.com/maps/api/js?callback=initialize</span><span class="er">&</span><span class="st">key=</span><span class="er"><</span><span class="st">mykey>"</span><span class="kw">></span></a>
<a class="sourceLine" id="cb4-20" data-line-number="20"> <span class="kw"></script></span></a>
<a class="sourceLine" id="cb4-21" data-line-number="21"> <span class="kw"></body></span></a>
<a class="sourceLine" id="cb4-22" data-line-number="22"><span class="kw"></html></span></a></code></pre></div>
<p><a href="http://karlbenedict.com/GEOG485-585/sample-files/GoogleMaps/js/mapPage_02.js">mapPage_02.js</a></p>
<div class="sourceCode" id="cb5"><pre class="sourceCode numberSource js numberLines"><code class="sourceCode javascript"><a class="sourceLine" id="cb5-1" data-line-number="1"><span class="kw">function</span> <span class="at">initialize</span>() <span class="op">{</span></a>
<a class="sourceLine" id="cb5-2" data-line-number="2"> <span class="kw">var</span> classroom <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084280</span><span class="op">,-</span><span class="fl">106.624073</span>)</a>
<a class="sourceLine" id="cb5-3" data-line-number="3"> <span class="kw">var</span> mapOptions <span class="op">=</span> <span class="op">{</span></a>
<a class="sourceLine" id="cb5-4" data-line-number="4"> <span class="dt">zoom</span><span class="op">:</span> <span class="dv">8</span><span class="op">,</span></a>
<a class="sourceLine" id="cb5-5" data-line-number="5"> <span class="dt">center</span><span class="op">:</span> classroom<span class="op">,</span></a>
<a class="sourceLine" id="cb5-6" data-line-number="6"> <span class="dt">mapTypeId</span><span class="op">:</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="va">MapTypeId</span>.<span class="at">SATELLITE</span></a>
<a class="sourceLine" id="cb5-7" data-line-number="7"> <span class="op">};</span></a>
<a class="sourceLine" id="cb5-8" data-line-number="8"> <span class="kw">var</span> map <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">Map</span>(</a>
<a class="sourceLine" id="cb5-9" data-line-number="9"> <span class="va">document</span>.<span class="at">getElementById</span>(<span class="st">"map_canvas"</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb5-10" data-line-number="10"> mapOptions)<span class="op">;</span></a>
<a class="sourceLine" id="cb5-11" data-line-number="11"><span class="op">}</span></a>
<a class="sourceLine" id="cb5-12" data-line-number="12"></a></code></pre></div>
</div>
<h3 id="simple---hybrid" class="module02a02a">Simple - Hybrid</h3>
<p><img src="images/gmaps03.png" alt="gmaps03.html preview" /> </p>
<h3 id="simple---hybrid-code" class="module02a02a">Simple - Hybrid Code</h3>
<div class="codeTable">
<p><a href="http://karlbenedict.com/GEOG485-585/sample-files/GoogleMaps/gmaps03.html">gmaps03.html</a></p>
<div class="sourceCode" id="cb6"><pre class="sourceCode numberSource html numberLines"><code class="sourceCode html"><a class="sourceLine" id="cb6-1" data-line-number="1"><span class="dt"><!DOCTYPE </span>html<span class="dt">></span></a>
<a class="sourceLine" id="cb6-2" data-line-number="2"><span class="kw"><html></span></a>
<a class="sourceLine" id="cb6-3" data-line-number="3"> <span class="kw"><head></span></a>
<a class="sourceLine" id="cb6-4" data-line-number="4"> <span class="kw"><link</span><span class="ot"> rel=</span><span class="st">"stylesheet"</span><span class="ot"> type=</span><span class="st">"text/css"</span><span class="ot"> href=</span><span class="st">"css/mapPage.css"</span><span class="kw">></span></a>
<a class="sourceLine" id="cb6-5" data-line-number="5"> <span class="kw"></head></span></a>
<a class="sourceLine" id="cb6-6" data-line-number="6"></a>
<a class="sourceLine" id="cb6-7" data-line-number="7"> <span class="kw"><body></span></a>
<a class="sourceLine" id="cb6-8" data-line-number="8"> <span class="kw"><h1></span>Sample Map<span class="kw"></h1></span></a>
<a class="sourceLine" id="cb6-9" data-line-number="9"> <span class="kw"><div</span><span class="ot"> id=</span><span class="st">"map_canvas"</span><span class="kw">></div></span></a>
<a class="sourceLine" id="cb6-10" data-line-number="10"></a>
<a class="sourceLine" id="cb6-11" data-line-number="11"> <span class="co"><!-- Let's put our JavaScript down here </span><span class="er">-------------------------------------------</span><span class="co">--></span></a>
<a class="sourceLine" id="cb6-12" data-line-number="12"> <span class="co"><!-- Load the external JavaScript file with the map definition code --></span></a>
<a class="sourceLine" id="cb6-13" data-line-number="13"> <span class="kw"><script</span><span class="ot"> src=</span><span class="st">"js/mapPage_03.js"</span><span class="kw">></script></span></a>
<a class="sourceLine" id="cb6-14" data-line-number="14"> </a>
<a class="sourceLine" id="cb6-15" data-line-number="15"> <span class="co"><!-- Load the API in asynchronous mode and execute the initialize </span></a>
<a class="sourceLine" id="cb6-16" data-line-number="16"><span class="co"> function when done --></span></a>
<a class="sourceLine" id="cb6-17" data-line-number="17"> </a>
<a class="sourceLine" id="cb6-18" data-line-number="18"> <span class="kw"><script</span><span class="ot"> async defer</span> </a>
<a class="sourceLine" id="cb6-19" data-line-number="19"><span class="ot"> src=</span><span class="st">"https://maps.googleapis.com/maps/api/js?callback=initialize</span><span class="er">&</span><span class="st">key=</span><span class="er"><</span><span class="st">mykey>"</span><span class="kw">></span></a>
<a class="sourceLine" id="cb6-20" data-line-number="20"> <span class="kw"></script></span></a>
<a class="sourceLine" id="cb6-21" data-line-number="21"> <span class="kw"></body></span></a>
<a class="sourceLine" id="cb6-22" data-line-number="22"><span class="kw"></html></span></a></code></pre></div>
<p><a href="http://karlbenedict.com/GEOG485-585/sample-files/GoogleMaps/js/mapPage_03.js">mapPage_03.js</a></p>
<div class="sourceCode" id="cb7"><pre class="sourceCode numberSource js numberLines"><code class="sourceCode javascript"><a class="sourceLine" id="cb7-1" data-line-number="1"><span class="kw">function</span> <span class="at">initialize</span>() <span class="op">{</span></a>
<a class="sourceLine" id="cb7-2" data-line-number="2"> <span class="kw">var</span> classroom <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084280</span><span class="op">,-</span><span class="fl">106.624073</span>)</a>
<a class="sourceLine" id="cb7-3" data-line-number="3"> <span class="kw">var</span> mapOptions <span class="op">=</span> <span class="op">{</span></a>
<a class="sourceLine" id="cb7-4" data-line-number="4"> <span class="dt">zoom</span><span class="op">:</span> <span class="dv">8</span><span class="op">,</span></a>
<a class="sourceLine" id="cb7-5" data-line-number="5"> <span class="dt">center</span><span class="op">:</span> classroom<span class="op">,</span></a>
<a class="sourceLine" id="cb7-6" data-line-number="6"> <span class="dt">mapTypeId</span><span class="op">:</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="va">MapTypeId</span>.<span class="at">HYBRID</span></a>
<a class="sourceLine" id="cb7-7" data-line-number="7"> <span class="op">};</span></a>
<a class="sourceLine" id="cb7-8" data-line-number="8"> <span class="kw">var</span> map <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">Map</span>(</a>
<a class="sourceLine" id="cb7-9" data-line-number="9"> <span class="va">document</span>.<span class="at">getElementById</span>(<span class="st">"map_canvas"</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb7-10" data-line-number="10"> mapOptions)<span class="op">;</span></a>
<a class="sourceLine" id="cb7-11" data-line-number="11"><span class="op">}</span></a>
<a class="sourceLine" id="cb7-12" data-line-number="12"></a></code></pre></div>
</div>
<h3 id="simple---terrain" class="module02a02a">Simple - Terrain</h3>
<p><img src="images/gmaps04.png" alt="gmaps04.html preview" /> </p>
<h3 id="simple---terrain-code" class="module02a02a">Simple - Terrain Code</h3>
<div class="codeTable">
<p><a href="http://karlbenedict.com/GEOG485-585/sample-files/GoogleMaps/gmaps04.html">gmaps04.html</a></p>
<div class="sourceCode" id="cb8"><pre class="sourceCode numberSource html numberLines"><code class="sourceCode html"><a class="sourceLine" id="cb8-1" data-line-number="1"><span class="dt"><!DOCTYPE </span>html<span class="dt">></span></a>
<a class="sourceLine" id="cb8-2" data-line-number="2"><span class="kw"><html></span></a>
<a class="sourceLine" id="cb8-3" data-line-number="3"> <span class="kw"><head></span></a>
<a class="sourceLine" id="cb8-4" data-line-number="4"> <span class="kw"><link</span><span class="ot"> rel=</span><span class="st">"stylesheet"</span><span class="ot"> type=</span><span class="st">"text/css"</span><span class="ot"> href=</span><span class="st">"css/mapPage.css"</span><span class="kw">></span></a>
<a class="sourceLine" id="cb8-5" data-line-number="5"> <span class="kw"></head></span></a>
<a class="sourceLine" id="cb8-6" data-line-number="6"></a>
<a class="sourceLine" id="cb8-7" data-line-number="7"> <span class="kw"><body></span></a>
<a class="sourceLine" id="cb8-8" data-line-number="8"> <span class="kw"><h1></span>Sample Map<span class="kw"></h1></span></a>
<a class="sourceLine" id="cb8-9" data-line-number="9"> <span class="kw"><div</span><span class="ot"> id=</span><span class="st">"map_canvas"</span><span class="kw">></div></span></a>
<a class="sourceLine" id="cb8-10" data-line-number="10"></a>
<a class="sourceLine" id="cb8-11" data-line-number="11"> <span class="co"><!-- Let's put our JavaScript down here </span><span class="er">-------------------------------------------</span><span class="co">--></span></a>
<a class="sourceLine" id="cb8-12" data-line-number="12"> <span class="co"><!-- Load the external JavaScript file with the map definition code --></span></a>
<a class="sourceLine" id="cb8-13" data-line-number="13"> <span class="kw"><script</span><span class="ot"> src=</span><span class="st">"js/mapPage_04.js"</span><span class="kw">></script></span></a>
<a class="sourceLine" id="cb8-14" data-line-number="14"> </a>
<a class="sourceLine" id="cb8-15" data-line-number="15"> <span class="co"><!-- Load the API in asynchronous mode and execute the initialize </span></a>
<a class="sourceLine" id="cb8-16" data-line-number="16"><span class="co"> function when done --></span></a>
<a class="sourceLine" id="cb8-17" data-line-number="17"> </a>
<a class="sourceLine" id="cb8-18" data-line-number="18"> <span class="kw"><script</span><span class="ot"> async defer</span> </a>
<a class="sourceLine" id="cb8-19" data-line-number="19"><span class="ot"> src=</span><span class="st">"https://maps.googleapis.com/maps/api/js?callback=initialize</span><span class="er">&</span><span class="st">key=</span><span class="er"><</span><span class="st">mykey>"</span><span class="kw">></span></a>
<a class="sourceLine" id="cb8-20" data-line-number="20"> <span class="kw"></script></span></a>
<a class="sourceLine" id="cb8-21" data-line-number="21"> <span class="kw"></body></span></a>
<a class="sourceLine" id="cb8-22" data-line-number="22"><span class="kw"></html></span></a></code></pre></div>
<p><a href="http://karlbenedict.com/GEOG485-585/sample-files/GoogleMaps/js/mapPage_04.js">mapPage_04.js</a></p>
<div class="sourceCode" id="cb9"><pre class="sourceCode numberSource js numberLines"><code class="sourceCode javascript"><a class="sourceLine" id="cb9-1" data-line-number="1"><span class="kw">function</span> <span class="at">initialize</span>() <span class="op">{</span></a>
<a class="sourceLine" id="cb9-2" data-line-number="2"> <span class="kw">var</span> classroom <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084280</span><span class="op">,-</span><span class="fl">106.624073</span>)</a>
<a class="sourceLine" id="cb9-3" data-line-number="3"> <span class="kw">var</span> mapOptions <span class="op">=</span> <span class="op">{</span></a>
<a class="sourceLine" id="cb9-4" data-line-number="4"> <span class="dt">zoom</span><span class="op">:</span> <span class="dv">8</span><span class="op">,</span></a>
<a class="sourceLine" id="cb9-5" data-line-number="5"> <span class="dt">center</span><span class="op">:</span> classroom<span class="op">,</span></a>
<a class="sourceLine" id="cb9-6" data-line-number="6"> <span class="dt">mapTypeId</span><span class="op">:</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="va">MapTypeId</span>.<span class="at">TERRAIN</span></a>
<a class="sourceLine" id="cb9-7" data-line-number="7"> <span class="op">};</span></a>
<a class="sourceLine" id="cb9-8" data-line-number="8"> <span class="kw">var</span> map <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">Map</span>(</a>
<a class="sourceLine" id="cb9-9" data-line-number="9"> <span class="va">document</span>.<span class="at">getElementById</span>(<span class="st">"map_canvas"</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb9-10" data-line-number="10"> mapOptions)<span class="op">;</span></a>
<a class="sourceLine" id="cb9-11" data-line-number="11"><span class="op">}</span></a>
<a class="sourceLine" id="cb9-12" data-line-number="12"></a></code></pre></div>
</div>
<h3 id="simple---hybrid---zoomed" class="module02a02a">Simple - Hybrid - Zoomed</h3>
<p><img src="images/gmaps05.png" alt="gmaps05.html preview" /> </p>
<h3 id="simple---hybrid---zoomed-code" class="module02a02a">Simple - Hybrid - Zoomed Code</h3>
<div class="codeTable">
<p><a href="http://karlbenedict.com/GEOG485-585/sample-files/GoogleMaps/gmaps05.html">gmaps05.html</a></p>
<div class="sourceCode" id="cb10"><pre class="sourceCode numberSource html numberLines"><code class="sourceCode html"><a class="sourceLine" id="cb10-1" data-line-number="1"><span class="dt"><!DOCTYPE </span>html<span class="dt">></span></a>
<a class="sourceLine" id="cb10-2" data-line-number="2"><span class="kw"><html></span></a>
<a class="sourceLine" id="cb10-3" data-line-number="3"> <span class="kw"><head></span></a>
<a class="sourceLine" id="cb10-4" data-line-number="4"> <span class="kw"><link</span><span class="ot"> rel=</span><span class="st">"stylesheet"</span><span class="ot"> type=</span><span class="st">"text/css"</span><span class="ot"> href=</span><span class="st">"css/mapPage.css"</span><span class="kw">></span></a>
<a class="sourceLine" id="cb10-5" data-line-number="5"> <span class="kw"></head></span></a>
<a class="sourceLine" id="cb10-6" data-line-number="6"></a>
<a class="sourceLine" id="cb10-7" data-line-number="7"> <span class="kw"><body></span></a>
<a class="sourceLine" id="cb10-8" data-line-number="8"> <span class="kw"><h1></span>Sample Map<span class="kw"></h1></span></a>
<a class="sourceLine" id="cb10-9" data-line-number="9"> <span class="kw"><div</span><span class="ot"> id=</span><span class="st">"map_canvas"</span><span class="kw">></div></span></a>
<a class="sourceLine" id="cb10-10" data-line-number="10"></a>
<a class="sourceLine" id="cb10-11" data-line-number="11"> <span class="co"><!-- Let's put our JavaScript down here </span><span class="er">-------------------------------------------</span><span class="co">--></span></a>
<a class="sourceLine" id="cb10-12" data-line-number="12"> <span class="co"><!-- Load the external JavaScript file with the map definition code --></span></a>
<a class="sourceLine" id="cb10-13" data-line-number="13"> <span class="kw"><script</span><span class="ot"> src=</span><span class="st">"js/mapPage_05.js"</span><span class="kw">></script></span></a>
<a class="sourceLine" id="cb10-14" data-line-number="14"> </a>
<a class="sourceLine" id="cb10-15" data-line-number="15"> <span class="co"><!-- Load the API in asynchronous mode and execute the initialize </span></a>
<a class="sourceLine" id="cb10-16" data-line-number="16"><span class="co"> function when done --></span></a>
<a class="sourceLine" id="cb10-17" data-line-number="17"> </a>
<a class="sourceLine" id="cb10-18" data-line-number="18"> <span class="kw"><script</span><span class="ot"> async defer</span> </a>
<a class="sourceLine" id="cb10-19" data-line-number="19"><span class="ot"> src=</span><span class="st">"https://maps.googleapis.com/maps/api/js?callback=initialize</span><span class="er">&</span><span class="st">key=</span><span class="er"><</span><span class="st">mykey>"</span><span class="kw">></span></a>
<a class="sourceLine" id="cb10-20" data-line-number="20"> <span class="kw"></script></span></a>
<a class="sourceLine" id="cb10-21" data-line-number="21"> <span class="kw"></body></span></a>
<a class="sourceLine" id="cb10-22" data-line-number="22"><span class="kw"></html></span></a></code></pre></div>
<p><a href="http://karlbenedict.com/GEOG485-585/sample-files/GoogleMaps/js/mapPage_05.js">mapPage_05.js</a></p>
<div class="sourceCode" id="cb11"><pre class="sourceCode numberSource js numberLines"><code class="sourceCode javascript"><a class="sourceLine" id="cb11-1" data-line-number="1"><span class="kw">function</span> <span class="at">initialize</span>() <span class="op">{</span></a>
<a class="sourceLine" id="cb11-2" data-line-number="2"> <span class="kw">var</span> classroom <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084280</span><span class="op">,-</span><span class="fl">106.624073</span>)</a>
<a class="sourceLine" id="cb11-3" data-line-number="3"> <span class="kw">var</span> mapOptions <span class="op">=</span> <span class="op">{</span></a>
<a class="sourceLine" id="cb11-4" data-line-number="4"> <span class="dt">zoom</span><span class="op">:</span> <span class="dv">18</span><span class="op">,</span></a>
<a class="sourceLine" id="cb11-5" data-line-number="5"> <span class="dt">center</span><span class="op">:</span> classroom<span class="op">,</span></a>
<a class="sourceLine" id="cb11-6" data-line-number="6"> <span class="dt">mapTypeId</span><span class="op">:</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="va">MapTypeId</span>.<span class="at">TERRAIN</span></a>
<a class="sourceLine" id="cb11-7" data-line-number="7"> <span class="op">};</span></a>
<a class="sourceLine" id="cb11-8" data-line-number="8"> <span class="kw">var</span> map <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">Map</span>(</a>
<a class="sourceLine" id="cb11-9" data-line-number="9"> <span class="va">document</span>.<span class="at">getElementById</span>(<span class="st">"map_canvas"</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb11-10" data-line-number="10"> mapOptions)<span class="op">;</span></a>
<a class="sourceLine" id="cb11-11" data-line-number="11"><span class="op">}</span></a>
<a class="sourceLine" id="cb11-12" data-line-number="12"></a></code></pre></div>
</div>
<h3 id="simple---zoomed---modified-controls" class="module02a02a">Simple - Zoomed - Modified Controls</h3>
<p><img src="images/gmaps06.png" alt="gmaps06.html preview" /> </p>
<h3 id="simple---zoomed---modified-controls-code" class="module02a02a">Simple - Zoomed - Modified Controls Code</h3>
<div class="codeTable">
<p><a href="http://karlbenedict.com/GEOG485-585/sample-files/GoogleMaps/gmaps06.html">gmaps06.html</a></p>
<div class="sourceCode" id="cb12"><pre class="sourceCode numberSource html numberLines"><code class="sourceCode html"><a class="sourceLine" id="cb12-1" data-line-number="1"><span class="dt"><!DOCTYPE </span>html<span class="dt">></span></a>
<a class="sourceLine" id="cb12-2" data-line-number="2"><span class="kw"><html></span></a>
<a class="sourceLine" id="cb12-3" data-line-number="3"> <span class="kw"><head></span></a>
<a class="sourceLine" id="cb12-4" data-line-number="4"> <span class="kw"><link</span><span class="ot"> rel=</span><span class="st">"stylesheet"</span><span class="ot"> type=</span><span class="st">"text/css"</span><span class="ot"> href=</span><span class="st">"css/mapPage.css"</span><span class="kw">></span></a>
<a class="sourceLine" id="cb12-5" data-line-number="5"> <span class="kw"></head></span></a>
<a class="sourceLine" id="cb12-6" data-line-number="6"></a>
<a class="sourceLine" id="cb12-7" data-line-number="7"> <span class="kw"><body></span></a>
<a class="sourceLine" id="cb12-8" data-line-number="8"> <span class="kw"><h1></span>Sample Map<span class="kw"></h1></span></a>
<a class="sourceLine" id="cb12-9" data-line-number="9"> <span class="kw"><div</span><span class="ot"> id=</span><span class="st">"map_canvas"</span><span class="kw">></div></span></a>
<a class="sourceLine" id="cb12-10" data-line-number="10"></a>
<a class="sourceLine" id="cb12-11" data-line-number="11"> <span class="co"><!-- Let's put our JavaScript down here </span><span class="er">-------------------------------------------</span><span class="co">--></span></a>
<a class="sourceLine" id="cb12-12" data-line-number="12"> <span class="co"><!-- Load the external JavaScript file with the map definition code --></span></a>
<a class="sourceLine" id="cb12-13" data-line-number="13"> <span class="kw"><script</span><span class="ot"> src=</span><span class="st">"js/mapPage_06.js"</span><span class="kw">></script></span></a>
<a class="sourceLine" id="cb12-14" data-line-number="14"> </a>
<a class="sourceLine" id="cb12-15" data-line-number="15"> <span class="co"><!-- Load the API in asynchronous mode and execute the initialize </span></a>
<a class="sourceLine" id="cb12-16" data-line-number="16"><span class="co"> function when done --></span></a>
<a class="sourceLine" id="cb12-17" data-line-number="17"> </a>
<a class="sourceLine" id="cb12-18" data-line-number="18"> <span class="kw"><script</span><span class="ot"> async defer</span> </a>
<a class="sourceLine" id="cb12-19" data-line-number="19"><span class="ot"> src=</span><span class="st">"https://maps.googleapis.com/maps/api/js?callback=initialize</span><span class="er">&</span><span class="st">key=</span><span class="er"><</span><span class="st">mykey>"</span><span class="kw">></span></a>
<a class="sourceLine" id="cb12-20" data-line-number="20"> <span class="kw"></script></span></a>
<a class="sourceLine" id="cb12-21" data-line-number="21"> <span class="kw"></body></span></a>
<a class="sourceLine" id="cb12-22" data-line-number="22"><span class="kw"></html></span></a></code></pre></div>
<p><a href="http://karlbenedict.com/GEOG485-585/sample-files/GoogleMaps/js/mapPage_06.js">mapPage_06.js</a></p>
<div class="sourceCode" id="cb13"><pre class="sourceCode numberSource js numberLines"><code class="sourceCode javascript"><a class="sourceLine" id="cb13-1" data-line-number="1"><span class="kw">function</span> <span class="at">initialize</span>() <span class="op">{</span></a>
<a class="sourceLine" id="cb13-2" data-line-number="2"><span class="kw">var</span> classroom <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084280</span><span class="op">,-</span><span class="fl">106.624073</span>)</a>
<a class="sourceLine" id="cb13-3" data-line-number="3"><span class="kw">var</span> myOptions <span class="op">=</span> <span class="op">{</span></a>
<a class="sourceLine" id="cb13-4" data-line-number="4"> <span class="dt">zoom</span><span class="op">:</span> <span class="dv">18</span><span class="op">,</span></a>
<a class="sourceLine" id="cb13-5" data-line-number="5"> <span class="dt">center</span><span class="op">:</span> classroom<span class="op">,</span></a>
<a class="sourceLine" id="cb13-6" data-line-number="6"> <span class="dt">mapTypeId</span><span class="op">:</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="va">MapTypeId</span>.<span class="at">HYBRID</span><span class="op">,</span></a>
<a class="sourceLine" id="cb13-7" data-line-number="7"> <span class="dt">zoomControl</span><span class="op">:</span> <span class="kw">true</span><span class="op">,</span></a>
<a class="sourceLine" id="cb13-8" data-line-number="8"> <span class="dt">zoomControlOptions</span><span class="op">:</span> <span class="op">{</span><span class="dt">style</span><span class="op">:</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="va">ZoomControlStyle</span>.<span class="at">SMALL</span><span class="op">},</span></a>
<a class="sourceLine" id="cb13-9" data-line-number="9"> <span class="dt">mapTypeControl</span><span class="op">:</span> <span class="kw">true</span><span class="op">,</span></a>
<a class="sourceLine" id="cb13-10" data-line-number="10"> <span class="dt">mapTypeControlOptions</span><span class="op">:</span> <span class="op">{</span></a>
<a class="sourceLine" id="cb13-11" data-line-number="11"> <span class="dt">style</span><span class="op">:</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="va">MapTypeControlStyle</span>.<span class="at">DROPDOWN_MENU</span><span class="op">},</span></a>
<a class="sourceLine" id="cb13-12" data-line-number="12"> <span class="dt">streetViewControl</span><span class="op">:</span> <span class="kw">false</span></a>
<a class="sourceLine" id="cb13-13" data-line-number="13"><span class="op">};</span></a>
<a class="sourceLine" id="cb13-14" data-line-number="14"><span class="kw">var</span> map <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">Map</span>(</a>
<a class="sourceLine" id="cb13-15" data-line-number="15"> <span class="va">document</span>.<span class="at">getElementById</span>(<span class="st">"map_canvas"</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb13-16" data-line-number="16"> myOptions)<span class="op">;</span></a>
<a class="sourceLine" id="cb13-17" data-line-number="17"><span class="op">}</span></a>
<a class="sourceLine" id="cb13-18" data-line-number="18"></a></code></pre></div>
</div>
<h3 id="markers" class="module02a02a">Markers</h3>
<p><img src="images/gmaps07.png" alt="gmaps07.html preview" /> </p>
<h3 id="markers-code" class="module02a02a">Markers Code</h3>
<div class="codeTable">
<p><a href="http://karlbenedict.com/GEOG485-585/sample-files/GoogleMaps/gmaps07.html">gmaps07.html</a></p>
<div class="sourceCode" id="cb14"><pre class="sourceCode numberSource html numberLines"><code class="sourceCode html"><a class="sourceLine" id="cb14-1" data-line-number="1"><span class="dt"><!DOCTYPE </span>html<span class="dt">></span></a>
<a class="sourceLine" id="cb14-2" data-line-number="2"><span class="kw"><html></span></a>
<a class="sourceLine" id="cb14-3" data-line-number="3"> <span class="kw"><head></span></a>
<a class="sourceLine" id="cb14-4" data-line-number="4"> <span class="kw"><link</span><span class="ot"> rel=</span><span class="st">"stylesheet"</span><span class="ot"> type=</span><span class="st">"text/css"</span><span class="ot"> href=</span><span class="st">"css/mapPage.css"</span><span class="kw">></span></a>
<a class="sourceLine" id="cb14-5" data-line-number="5"> <span class="kw"></head></span></a>
<a class="sourceLine" id="cb14-6" data-line-number="6"></a>
<a class="sourceLine" id="cb14-7" data-line-number="7"> <span class="kw"><body></span></a>
<a class="sourceLine" id="cb14-8" data-line-number="8"> <span class="kw"><h1></span>Sample Map<span class="kw"></h1></span></a>
<a class="sourceLine" id="cb14-9" data-line-number="9"> <span class="kw"><div</span><span class="ot"> id=</span><span class="st">"map_canvas"</span><span class="kw">></div></span></a>
<a class="sourceLine" id="cb14-10" data-line-number="10"></a>
<a class="sourceLine" id="cb14-11" data-line-number="11"> <span class="co"><!-- Let's put our JavaScript down here </span><span class="er">-------------------------------------------</span><span class="co">--></span></a>
<a class="sourceLine" id="cb14-12" data-line-number="12"> <span class="co"><!-- Load the external JavaScript file with the map definition code --></span></a>
<a class="sourceLine" id="cb14-13" data-line-number="13"> <span class="kw"><script</span><span class="ot"> src=</span><span class="st">"js/mapPage_07.js"</span><span class="kw">></script></span></a>
<a class="sourceLine" id="cb14-14" data-line-number="14"> </a>
<a class="sourceLine" id="cb14-15" data-line-number="15"> <span class="co"><!-- Load the API in asynchronous mode and execute the initialize </span></a>
<a class="sourceLine" id="cb14-16" data-line-number="16"><span class="co"> function when done --></span></a>
<a class="sourceLine" id="cb14-17" data-line-number="17"> </a>
<a class="sourceLine" id="cb14-18" data-line-number="18"> <span class="kw"><script</span><span class="ot"> async defer</span> </a>
<a class="sourceLine" id="cb14-19" data-line-number="19"><span class="ot"> src=</span><span class="st">"https://maps.googleapis.com/maps/api/js?callback=initialize</span><span class="er">&</span><span class="st">key=</span><span class="er"><</span><span class="st">mykey>"</span><span class="kw">></span></a>
<a class="sourceLine" id="cb14-20" data-line-number="20"> <span class="kw"></script></span></a>
<a class="sourceLine" id="cb14-21" data-line-number="21"> <span class="kw"></body></span></a>
<a class="sourceLine" id="cb14-22" data-line-number="22"><span class="kw"></html></span></a></code></pre></div>
<p><a href="http://karlbenedict.com/GEOG485-585/sample-files/GoogleMaps/js/mapPage_07.js">mapPage_07.js</a></p>
<div class="sourceCode" id="cb15"><pre class="sourceCode numberSource js numberLines"><code class="sourceCode javascript"><a class="sourceLine" id="cb15-1" data-line-number="1"><span class="kw">function</span> <span class="at">initialize</span>() <span class="op">{</span></a>
<a class="sourceLine" id="cb15-2" data-line-number="2"> <span class="kw">var</span> classroom <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084280</span><span class="op">,-</span><span class="fl">106.624073</span>)</a>
<a class="sourceLine" id="cb15-3" data-line-number="3"> <span class="kw">var</span> office <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084506</span><span class="op">,-</span><span class="fl">106.624899</span>)</a>
<a class="sourceLine" id="cb15-4" data-line-number="4"> <span class="kw">var</span> myOptions <span class="op">=</span> <span class="op">{</span></a>
<a class="sourceLine" id="cb15-5" data-line-number="5"> <span class="dt">zoom</span><span class="op">:</span> <span class="dv">18</span><span class="op">,</span></a>
<a class="sourceLine" id="cb15-6" data-line-number="6"> <span class="dt">center</span><span class="op">:</span> classroom<span class="op">,</span></a>
<a class="sourceLine" id="cb15-7" data-line-number="7"> <span class="dt">mapTypeId</span><span class="op">:</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="va">MapTypeId</span>.<span class="at">HYBRID</span></a>
<a class="sourceLine" id="cb15-8" data-line-number="8"> <span class="op">};</span></a>
<a class="sourceLine" id="cb15-9" data-line-number="9"> <span class="kw">var</span> map <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">Map</span>(</a>
<a class="sourceLine" id="cb15-10" data-line-number="10"> <span class="va">document</span>.<span class="at">getElementById</span>(<span class="st">"map_canvas"</span>)<span class="op">,</span> </a>
<a class="sourceLine" id="cb15-11" data-line-number="11"> myOptions)<span class="op">;</span></a>
<a class="sourceLine" id="cb15-12" data-line-number="12"></a>
<a class="sourceLine" id="cb15-13" data-line-number="13"> <span class="kw">var</span> classroomMarker <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">Marker</span>(<span class="op">{</span></a>
<a class="sourceLine" id="cb15-14" data-line-number="14"> <span class="dt">position</span><span class="op">:</span> classroom<span class="op">,</span></a>
<a class="sourceLine" id="cb15-15" data-line-number="15"> <span class="dt">title</span><span class="op">:</span><span class="st">"Geography 485L/585L Classroom, Bandelier East, Room 106"</span></a>
<a class="sourceLine" id="cb15-16" data-line-number="16"> <span class="op">}</span>)<span class="op">;</span></a>
<a class="sourceLine" id="cb15-17" data-line-number="17"> <span class="va">classroomMarker</span>.<span class="at">setMap</span>(map)<span class="op">;</span></a>
<a class="sourceLine" id="cb15-18" data-line-number="18"></a>
<a class="sourceLine" id="cb15-19" data-line-number="19"> <span class="kw">var</span> officeMarker <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">Marker</span>(<span class="op">{</span></a>
<a class="sourceLine" id="cb15-20" data-line-number="20"> <span class="dt">position</span><span class="op">:</span> office<span class="op">,</span></a>
<a class="sourceLine" id="cb15-21" data-line-number="21"> <span class="dt">title</span><span class="op">:</span><span class="st">"Office, Bandelier West, Room 107"</span></a>
<a class="sourceLine" id="cb15-22" data-line-number="22"> <span class="op">}</span>)<span class="op">;</span></a>
<a class="sourceLine" id="cb15-23" data-line-number="23"> <span class="va">officeMarker</span>.<span class="at">setMap</span>(map)<span class="op">;</span></a>
<a class="sourceLine" id="cb15-24" data-line-number="24"><span class="op">}</span></a>
<a class="sourceLine" id="cb15-25" data-line-number="25"></a></code></pre></div>
</div>
<h3 id="polyline" class="module02a02a">Polyline</h3>
<p><img src="images/gmaps08.png" alt="gmaps08.html preview" /> </p>
<h3 id="polyline-code" class="module02a02a">Polyline Code</h3>
<div class="codeTable">
<p><a href="http://karlbenedict.com/GEOG485-585/sample-files/GoogleMaps/gmaps08.html">gmaps08.html</a></p>
<div class="sourceCode" id="cb16"><pre class="sourceCode numberSource html numberLines"><code class="sourceCode html"><a class="sourceLine" id="cb16-1" data-line-number="1"><span class="dt"><!DOCTYPE </span>html<span class="dt">></span></a>
<a class="sourceLine" id="cb16-2" data-line-number="2"><span class="kw"><html></span></a>
<a class="sourceLine" id="cb16-3" data-line-number="3"> <span class="kw"><head></span></a>
<a class="sourceLine" id="cb16-4" data-line-number="4"> <span class="kw"><link</span><span class="ot"> rel=</span><span class="st">"stylesheet"</span><span class="ot"> type=</span><span class="st">"text/css"</span><span class="ot"> href=</span><span class="st">"css/mapPage.css"</span><span class="kw">></span></a>
<a class="sourceLine" id="cb16-5" data-line-number="5"> <span class="kw"></head></span></a>
<a class="sourceLine" id="cb16-6" data-line-number="6"></a>
<a class="sourceLine" id="cb16-7" data-line-number="7"> <span class="kw"><body></span></a>
<a class="sourceLine" id="cb16-8" data-line-number="8"> <span class="kw"><h1></span>Sample Map<span class="kw"></h1></span></a>
<a class="sourceLine" id="cb16-9" data-line-number="9"> <span class="kw"><div</span><span class="ot"> id=</span><span class="st">"map_canvas"</span><span class="kw">></div></span></a>
<a class="sourceLine" id="cb16-10" data-line-number="10"></a>
<a class="sourceLine" id="cb16-11" data-line-number="11"> <span class="co"><!-- Let's put our JavaScript down here </span><span class="er">-------------------------------------------</span><span class="co">--></span></a>
<a class="sourceLine" id="cb16-12" data-line-number="12"> <span class="co"><!-- Load the external JavaScript file with the map definition code --></span></a>
<a class="sourceLine" id="cb16-13" data-line-number="13"> <span class="kw"><script</span><span class="ot"> src=</span><span class="st">"js/mapPage_08.js"</span><span class="kw">></script></span></a>
<a class="sourceLine" id="cb16-14" data-line-number="14"> </a>
<a class="sourceLine" id="cb16-15" data-line-number="15"> <span class="co"><!-- Load the API in asynchronous mode and execute the initialize </span></a>
<a class="sourceLine" id="cb16-16" data-line-number="16"><span class="co"> function when done --></span></a>
<a class="sourceLine" id="cb16-17" data-line-number="17"> </a>
<a class="sourceLine" id="cb16-18" data-line-number="18"> <span class="kw"><script</span><span class="ot"> async defer</span> </a>
<a class="sourceLine" id="cb16-19" data-line-number="19"><span class="ot"> src=</span><span class="st">"https://maps.googleapis.com/maps/api/js?callback=initialize</span><span class="er">&</span><span class="st">key=</span><span class="er"><</span><span class="st">mykey>"</span><span class="kw">></span></a>
<a class="sourceLine" id="cb16-20" data-line-number="20"> <span class="kw"></script></span></a>
<a class="sourceLine" id="cb16-21" data-line-number="21"> <span class="kw"></body></span></a>
<a class="sourceLine" id="cb16-22" data-line-number="22"><span class="kw"></html></span></a></code></pre></div>
<p><a href="http://karlbenedict.com/GEOG485-585/sample-files/GoogleMaps/js/mapPage_08.js">mapPage_08.js</a></p>
<div class="sourceCode" id="cb17"><pre class="sourceCode numberSource js numberLines"><code class="sourceCode javascript"><a class="sourceLine" id="cb17-1" data-line-number="1"> <span class="kw">var</span> classroom <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084280</span><span class="op">,-</span><span class="fl">106.624073</span>)</a>
<a class="sourceLine" id="cb17-2" data-line-number="2"> <span class="kw">var</span> office <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084506</span><span class="op">,-</span><span class="fl">106.624899</span>)</a>
<a class="sourceLine" id="cb17-3" data-line-number="3"> <span class="kw">var</span> myOptions <span class="op">=</span> <span class="op">{</span></a>
<a class="sourceLine" id="cb17-4" data-line-number="4"> <span class="dt">zoom</span><span class="op">:</span> <span class="dv">18</span><span class="op">,</span></a>
<a class="sourceLine" id="cb17-5" data-line-number="5"> <span class="dt">center</span><span class="op">:</span> classroom<span class="op">,</span></a>
<a class="sourceLine" id="cb17-6" data-line-number="6"> <span class="dt">mapTypeId</span><span class="op">:</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="va">MapTypeId</span>.<span class="at">HYBRID</span></a>
<a class="sourceLine" id="cb17-7" data-line-number="7"> <span class="op">};</span></a>
<a class="sourceLine" id="cb17-8" data-line-number="8"> <span class="kw">var</span> map <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">Map</span>(</a>
<a class="sourceLine" id="cb17-9" data-line-number="9"> <span class="va">document</span>.<span class="at">getElementById</span>(<span class="st">"map_canvas"</span>)<span class="op">,</span> </a>
<a class="sourceLine" id="cb17-10" data-line-number="10"> myOptions)<span class="op">;</span></a>
<a class="sourceLine" id="cb17-11" data-line-number="11"></a>
<a class="sourceLine" id="cb17-12" data-line-number="12"> <span class="kw">var</span> classroomMarker <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">Marker</span>(<span class="op">{</span></a>
<a class="sourceLine" id="cb17-13" data-line-number="13"> <span class="dt">position</span><span class="op">:</span> classroom<span class="op">,</span></a>
<a class="sourceLine" id="cb17-14" data-line-number="14"> <span class="dt">title</span><span class="op">:</span><span class="st">"Geography 485L/585L Classroom, Bandelier East, Room 106"</span></a>
<a class="sourceLine" id="cb17-15" data-line-number="15"> <span class="op">}</span>)<span class="op">;</span></a>
<a class="sourceLine" id="cb17-16" data-line-number="16"> <span class="va">classroomMarker</span>.<span class="at">setMap</span>(map)<span class="op">;</span></a>
<a class="sourceLine" id="cb17-17" data-line-number="17"></a>
<a class="sourceLine" id="cb17-18" data-line-number="18"> <span class="kw">var</span> officeMarker <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">Marker</span>(<span class="op">{</span></a>
<a class="sourceLine" id="cb17-19" data-line-number="19"> <span class="dt">position</span><span class="op">:</span> office<span class="op">,</span></a>
<a class="sourceLine" id="cb17-20" data-line-number="20"> <span class="dt">title</span><span class="op">:</span><span class="st">"Office, Bandelier West, Room 107"</span></a>
<a class="sourceLine" id="cb17-21" data-line-number="21"> <span class="op">}</span>)<span class="op">;</span></a>
<a class="sourceLine" id="cb17-22" data-line-number="22"> <span class="va">officeMarker</span>.<span class="at">setMap</span>(map)<span class="op">;</span> </a>
<a class="sourceLine" id="cb17-23" data-line-number="23"></a>
<a class="sourceLine" id="cb17-24" data-line-number="24"> <span class="kw">var</span> officeVisitCoordinates <span class="op">=</span> [</a>
<a class="sourceLine" id="cb17-25" data-line-number="25"> office<span class="op">,</span></a>
<a class="sourceLine" id="cb17-26" data-line-number="26"> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084445</span><span class="op">,-</span><span class="fl">106.624327</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb17-27" data-line-number="27"> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084309</span><span class="op">,-</span><span class="fl">106.624308</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb17-28" data-line-number="28"> classroom</a>
<a class="sourceLine" id="cb17-29" data-line-number="29"> ]<span class="op">;</span></a>
<a class="sourceLine" id="cb17-30" data-line-number="30"> <span class="kw">var</span> officePath <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">Polyline</span>(<span class="op">{</span></a>
<a class="sourceLine" id="cb17-31" data-line-number="31"> <span class="dt">path</span><span class="op">:</span> officeVisitCoordinates<span class="op">,</span></a>
<a class="sourceLine" id="cb17-32" data-line-number="32"> <span class="dt">strokeColor</span><span class="op">:</span> <span class="st">"#FF0000"</span><span class="op">,</span></a>
<a class="sourceLine" id="cb17-33" data-line-number="33"> <span class="dt">strokeOpacity</span><span class="op">:</span> <span class="fl">1.0</span><span class="op">,</span></a>
<a class="sourceLine" id="cb17-34" data-line-number="34"> <span class="dt">strokeWeight</span><span class="op">:</span> <span class="dv">2</span></a>
<a class="sourceLine" id="cb17-35" data-line-number="35"> <span class="op">}</span>)<span class="op">;</span></a>
<a class="sourceLine" id="cb17-36" data-line-number="36"> <span class="va">officePath</span>.<span class="at">setMap</span>(map)</a>
<a class="sourceLine" id="cb17-37" data-line-number="37">}</a>
<a class="sourceLine" id="cb17-38" data-line-number="38"></a></code></pre></div>
</div>
<h3 id="polygon" class="module02a02a">Polygon</h3>
<p><img src="images/gmaps09.png" alt="gmaps09.html preview" /> </p>
<h3 id="polygon-code" class="module02a02a">Polygon Code</h3>
<div class="codeTable">
<p><a href="http://karlbenedict.com/GEOG485-585/sample-files/GoogleMaps/gmaps09.html">gmaps09.html</a></p>
<div class="sourceCode" id="cb18"><pre class="sourceCode numberSource html numberLines"><code class="sourceCode html"><a class="sourceLine" id="cb18-1" data-line-number="1"><span class="dt"><!DOCTYPE </span>html<span class="dt">></span></a>
<a class="sourceLine" id="cb18-2" data-line-number="2"><span class="kw"><html></span></a>
<a class="sourceLine" id="cb18-3" data-line-number="3"> <span class="kw"><head></span></a>
<a class="sourceLine" id="cb18-4" data-line-number="4"> <span class="kw"><link</span><span class="ot"> rel=</span><span class="st">"stylesheet"</span><span class="ot"> type=</span><span class="st">"text/css"</span><span class="ot"> href=</span><span class="st">"css/mapPage.css"</span><span class="kw">></span></a>
<a class="sourceLine" id="cb18-5" data-line-number="5"> <span class="kw"></head></span></a>
<a class="sourceLine" id="cb18-6" data-line-number="6"></a>
<a class="sourceLine" id="cb18-7" data-line-number="7"> <span class="kw"><body></span></a>
<a class="sourceLine" id="cb18-8" data-line-number="8"> <span class="kw"><h1></span>Sample Map<span class="kw"></h1></span></a>
<a class="sourceLine" id="cb18-9" data-line-number="9"> <span class="kw"><div</span><span class="ot"> id=</span><span class="st">"map_canvas"</span><span class="kw">></div></span></a>
<a class="sourceLine" id="cb18-10" data-line-number="10"></a>
<a class="sourceLine" id="cb18-11" data-line-number="11"> <span class="co"><!-- Let's put our JavaScript down here </span><span class="er">-------------------------------------------</span><span class="co">--></span></a>
<a class="sourceLine" id="cb18-12" data-line-number="12"> <span class="co"><!-- Load the external JavaScript file with the map definition code --></span></a>
<a class="sourceLine" id="cb18-13" data-line-number="13"> <span class="kw"><script</span><span class="ot"> src=</span><span class="st">"js/mapPage_09.js"</span><span class="kw">></script></span></a>
<a class="sourceLine" id="cb18-14" data-line-number="14"> </a>
<a class="sourceLine" id="cb18-15" data-line-number="15"> <span class="co"><!-- Load the API in asynchronous mode and execute the initialize </span></a>
<a class="sourceLine" id="cb18-16" data-line-number="16"><span class="co"> function when done --></span></a>
<a class="sourceLine" id="cb18-17" data-line-number="17"> </a>
<a class="sourceLine" id="cb18-18" data-line-number="18"> <span class="kw"><script</span><span class="ot"> async defer</span> </a>
<a class="sourceLine" id="cb18-19" data-line-number="19"><span class="ot"> src=</span><span class="st">"https://maps.googleapis.com/maps/api/js?callback=initialize</span><span class="er">&</span><span class="st">key=</span><span class="er"><</span><span class="st">mykey>"</span><span class="kw">></span></a>
<a class="sourceLine" id="cb18-20" data-line-number="20"> <span class="kw"></script></span></a>
<a class="sourceLine" id="cb18-21" data-line-number="21"> <span class="kw"></body></span></a>
<a class="sourceLine" id="cb18-22" data-line-number="22"><span class="kw"></html></span></a></code></pre></div>
<p><a href="http://karlbenedict.com/GEOG485-585/sample-files/GoogleMaps/js/mapPage_09.js">mapPage_09.js</a></p>
<div class="sourceCode" id="cb19"><pre class="sourceCode numberSource js numberLines"><code class="sourceCode javascript"><a class="sourceLine" id="cb19-1" data-line-number="1"><span class="kw">function</span> <span class="at">initialize</span>() <span class="op">{</span></a>
<a class="sourceLine" id="cb19-2" data-line-number="2"> <span class="kw">var</span> classroom <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084280</span><span class="op">,-</span><span class="fl">106.624073</span>)</a>
<a class="sourceLine" id="cb19-3" data-line-number="3"> <span class="kw">var</span> office <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084506</span><span class="op">,-</span><span class="fl">106.624899</span>)</a>
<a class="sourceLine" id="cb19-4" data-line-number="4"> <span class="kw">var</span> myOptions <span class="op">=</span> <span class="op">{</span></a>
<a class="sourceLine" id="cb19-5" data-line-number="5"> <span class="dt">zoom</span><span class="op">:</span> <span class="dv">18</span><span class="op">,</span></a>
<a class="sourceLine" id="cb19-6" data-line-number="6"> <span class="dt">center</span><span class="op">:</span> classroom<span class="op">,</span></a>
<a class="sourceLine" id="cb19-7" data-line-number="7"> <span class="dt">mapTypeId</span><span class="op">:</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="va">MapTypeId</span>.<span class="at">HYBRID</span></a>
<a class="sourceLine" id="cb19-8" data-line-number="8"> <span class="op">};</span></a>
<a class="sourceLine" id="cb19-9" data-line-number="9"> <span class="kw">var</span> map <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">Map</span>(</a>
<a class="sourceLine" id="cb19-10" data-line-number="10"> <span class="va">document</span>.<span class="at">getElementById</span>(<span class="st">"map_canvas"</span>)<span class="op">,</span> </a>
<a class="sourceLine" id="cb19-11" data-line-number="11"> myOptions)<span class="op">;</span></a>
<a class="sourceLine" id="cb19-12" data-line-number="12"> <span class="kw">var</span> classroomMarker <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">Marker</span>(<span class="op">{</span></a>
<a class="sourceLine" id="cb19-13" data-line-number="13"> <span class="dt">position</span><span class="op">:</span> classroom<span class="op">,</span></a>
<a class="sourceLine" id="cb19-14" data-line-number="14"> <span class="dt">title</span><span class="op">:</span><span class="st">"Geography 485L/585L Classroom, Bandelier East, Room 106"</span></a>
<a class="sourceLine" id="cb19-15" data-line-number="15"> <span class="op">}</span>)<span class="op">;</span></a>
<a class="sourceLine" id="cb19-16" data-line-number="16"> <span class="va">classroomMarker</span>.<span class="at">setMap</span>(map)<span class="op">;</span></a>
<a class="sourceLine" id="cb19-17" data-line-number="17"> <span class="kw">var</span> officeMarker <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">Marker</span>(<span class="op">{</span></a>
<a class="sourceLine" id="cb19-18" data-line-number="18"> <span class="dt">position</span><span class="op">:</span> office<span class="op">,</span></a>
<a class="sourceLine" id="cb19-19" data-line-number="19"> <span class="dt">title</span><span class="op">:</span><span class="st">"Office, Bandelier West, Room 107"</span></a>
<a class="sourceLine" id="cb19-20" data-line-number="20"> <span class="op">}</span>)<span class="op">;</span></a>
<a class="sourceLine" id="cb19-21" data-line-number="21"> <span class="va">officeMarker</span>.<span class="at">setMap</span>(map)<span class="op">;</span> </a>
<a class="sourceLine" id="cb19-22" data-line-number="22"> <span class="kw">var</span> buildingCoordinates <span class="op">=</span> [</a>
<a class="sourceLine" id="cb19-23" data-line-number="23"> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084498</span><span class="op">,-</span><span class="fl">106.624921</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb19-24" data-line-number="24"> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084558</span><span class="op">,-</span><span class="fl">106.624911</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb19-25" data-line-number="25"> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084566</span><span class="op">,-</span><span class="fl">106.624970</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb19-26" data-line-number="26"> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084609</span><span class="op">,-</span><span class="fl">106.624966</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb19-27" data-line-number="27"> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084544</span><span class="op">,-</span><span class="fl">106.624383</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb19-28" data-line-number="28"> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084438</span><span class="op">,-</span><span class="fl">106.624317</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb19-29" data-line-number="29"> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084384</span><span class="op">,-</span><span class="fl">106.623922</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb19-30" data-line-number="30"> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084164</span><span class="op">,-</span><span class="fl">106.623970</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb19-31" data-line-number="31"> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084214</span><span class="op">,-</span><span class="fl">106.624324</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb19-32" data-line-number="32"> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084214</span><span class="op">,-</span><span class="fl">106.624324</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb19-33" data-line-number="33"> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084391</span><span class="op">,-</span><span class="fl">106.624284</span>)</a>
<a class="sourceLine" id="cb19-34" data-line-number="34"> ]<span class="op">;</span></a>
<a class="sourceLine" id="cb19-35" data-line-number="35"> <span class="kw">var</span> bldgPoly <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">Polygon</span>(<span class="op">{</span></a>
<a class="sourceLine" id="cb19-36" data-line-number="36"> <span class="dt">paths</span><span class="op">:</span> buildingCoordinates<span class="op">,</span></a>
<a class="sourceLine" id="cb19-37" data-line-number="37"> <span class="dt">strokeColor</span><span class="op">:</span> <span class="st">"#FF0000"</span><span class="op">,</span></a>
<a class="sourceLine" id="cb19-38" data-line-number="38"> <span class="dt">strokeOpacity</span><span class="op">:</span> <span class="fl">0.8</span><span class="op">,</span></a>
<a class="sourceLine" id="cb19-39" data-line-number="39"> <span class="dt">strokeWeight</span><span class="op">:</span> <span class="dv">2</span><span class="op">,</span></a>
<a class="sourceLine" id="cb19-40" data-line-number="40"> <span class="dt">fillColor</span><span class="op">:</span> <span class="st">"#FF0000"</span><span class="op">,</span></a>
<a class="sourceLine" id="cb19-41" data-line-number="41"> <span class="dt">fillOpacity</span><span class="op">:</span> <span class="fl">0.35</span></a>
<a class="sourceLine" id="cb19-42" data-line-number="42"> <span class="op">}</span>)<span class="op">;</span></a>
<a class="sourceLine" id="cb19-43" data-line-number="43"> <span class="va">bldgPoly</span>.<span class="at">setMap</span>(map)</a>
<a class="sourceLine" id="cb19-44" data-line-number="44"><span class="op">}</span></a>
<a class="sourceLine" id="cb19-45" data-line-number="45"></a></code></pre></div>
</div>
<h3 id="adding-an-info-window" class="module02a02a">Adding an Info Window</h3>
<p><img src="images/gmaps10.png" alt="gmaps10.html preview" /> </p>
<h3 id="adding-an-info-window-code" class="module02a02a">Adding an Info Window Code</h3>
<div class="codeTable">
<p><a href="http://karlbenedict.com/GEOG485-585/sample-files/GoogleMaps/gmaps10.html">gmaps10.html</a></p>
<div class="sourceCode" id="cb20"><pre class="sourceCode numberSource html numberLines"><code class="sourceCode html"><a class="sourceLine" id="cb20-1" data-line-number="1"><span class="dt"><!DOCTYPE </span>html<span class="dt">></span></a>
<a class="sourceLine" id="cb20-2" data-line-number="2"><span class="kw"><html></span></a>
<a class="sourceLine" id="cb20-3" data-line-number="3"> <span class="kw"><head></span></a>
<a class="sourceLine" id="cb20-4" data-line-number="4"> <span class="kw"><link</span><span class="ot"> rel=</span><span class="st">"stylesheet"</span><span class="ot"> type=</span><span class="st">"text/css"</span><span class="ot"> href=</span><span class="st">"css/mapPage.css"</span><span class="kw">></span></a>
<a class="sourceLine" id="cb20-5" data-line-number="5"> <span class="kw"></head></span></a>
<a class="sourceLine" id="cb20-6" data-line-number="6"></a>
<a class="sourceLine" id="cb20-7" data-line-number="7"> <span class="kw"><body></span></a>
<a class="sourceLine" id="cb20-8" data-line-number="8"> <span class="kw"><h1></span>Sample Map<span class="kw"></h1></span></a>
<a class="sourceLine" id="cb20-9" data-line-number="9"> <span class="kw"><div</span><span class="ot"> id=</span><span class="st">"map_canvas"</span><span class="kw">></div></span></a>
<a class="sourceLine" id="cb20-10" data-line-number="10"></a>
<a class="sourceLine" id="cb20-11" data-line-number="11"> <span class="co"><!-- Let's put our JavaScript down here </span><span class="er">-------------------------------------------</span><span class="co">--></span></a>
<a class="sourceLine" id="cb20-12" data-line-number="12"> <span class="co"><!-- Load the external JavaScript file with the map definition code --></span></a>
<a class="sourceLine" id="cb20-13" data-line-number="13"> <span class="kw"><script</span><span class="ot"> src=</span><span class="st">"js/mapPage_10.js"</span><span class="kw">></script></span></a>
<a class="sourceLine" id="cb20-14" data-line-number="14"> </a>
<a class="sourceLine" id="cb20-15" data-line-number="15"> <span class="co"><!-- Load the API in asynchronous mode and execute the initialize </span></a>
<a class="sourceLine" id="cb20-16" data-line-number="16"><span class="co"> function when done --></span></a>
<a class="sourceLine" id="cb20-17" data-line-number="17"> </a>
<a class="sourceLine" id="cb20-18" data-line-number="18"> <span class="kw"><script</span><span class="ot"> async defer</span> </a>
<a class="sourceLine" id="cb20-19" data-line-number="19"><span class="ot"> src=</span><span class="st">"https://maps.googleapis.com/maps/api/js?callback=initialize</span><span class="er">&</span><span class="st">key=</span><span class="er"><</span><span class="st">mykey>"</span><span class="kw">></span></a>
<a class="sourceLine" id="cb20-20" data-line-number="20"> <span class="kw"></script></span></a>
<a class="sourceLine" id="cb20-21" data-line-number="21"> <span class="kw"></body></span></a>
<a class="sourceLine" id="cb20-22" data-line-number="22"><span class="kw"></html></span></a></code></pre></div>
<p><a href="http://karlbenedict.com/GEOG485-585/sample-files/GoogleMaps/js/mapPage_10.js">mapPage_10.js</a></p>
<div class="sourceCode" id="cb21"><pre class="sourceCode numberSource js numberLines"><code class="sourceCode javascript"><a class="sourceLine" id="cb21-1" data-line-number="1"><span class="kw">function</span> <span class="at">initialize</span>() <span class="op">{</span></a>
<a class="sourceLine" id="cb21-2" data-line-number="2"> <span class="kw">var</span> classroom <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084280</span><span class="op">,-</span><span class="fl">106.624073</span>)</a>
<a class="sourceLine" id="cb21-3" data-line-number="3"> <span class="kw">var</span> office <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084506</span><span class="op">,-</span><span class="fl">106.624899</span>)</a>
<a class="sourceLine" id="cb21-4" data-line-number="4"> <span class="kw">var</span> myOptions <span class="op">=</span> <span class="op">{</span></a>
<a class="sourceLine" id="cb21-5" data-line-number="5"> <span class="dt">zoom</span><span class="op">:</span> <span class="dv">18</span><span class="op">,</span></a>
<a class="sourceLine" id="cb21-6" data-line-number="6"> <span class="dt">center</span><span class="op">:</span> classroom<span class="op">,</span></a>
<a class="sourceLine" id="cb21-7" data-line-number="7"> <span class="dt">mapTypeId</span><span class="op">:</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="va">MapTypeId</span>.<span class="at">HYBRID</span></a>
<a class="sourceLine" id="cb21-8" data-line-number="8"> <span class="op">};</span></a>
<a class="sourceLine" id="cb21-9" data-line-number="9"> <span class="kw">var</span> map <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">Map</span>(</a>
<a class="sourceLine" id="cb21-10" data-line-number="10"> <span class="va">document</span>.<span class="at">getElementById</span>(<span class="st">"map_canvas"</span>)<span class="op">,</span> </a>
<a class="sourceLine" id="cb21-11" data-line-number="11"> myOptions)<span class="op">;</span></a>
<a class="sourceLine" id="cb21-12" data-line-number="12"> <span class="kw">var</span> classroomMarker <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">Marker</span>(<span class="op">{</span></a>
<a class="sourceLine" id="cb21-13" data-line-number="13"> <span class="dt">position</span><span class="op">:</span> classroom<span class="op">,</span></a>
<a class="sourceLine" id="cb21-14" data-line-number="14"> <span class="dt">title</span><span class="op">:</span><span class="st">"Geography 485L/585L Classroom, Bandelier East, Room 106"</span></a>
<a class="sourceLine" id="cb21-15" data-line-number="15"> <span class="op">}</span>)<span class="op">;</span></a>
<a class="sourceLine" id="cb21-16" data-line-number="16"> <span class="va">classroomMarker</span>.<span class="at">setMap</span>(map)<span class="op">;</span></a>
<a class="sourceLine" id="cb21-17" data-line-number="17"> <span class="kw">var</span> officeMarker <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">Marker</span>(<span class="op">{</span></a>
<a class="sourceLine" id="cb21-18" data-line-number="18"> <span class="dt">position</span><span class="op">:</span> office<span class="op">,</span></a>
<a class="sourceLine" id="cb21-19" data-line-number="19"> <span class="dt">title</span><span class="op">:</span><span class="st">"Office, Bandelier West, Room 107"</span></a>
<a class="sourceLine" id="cb21-20" data-line-number="20"> <span class="op">}</span>)<span class="op">;</span></a>
<a class="sourceLine" id="cb21-21" data-line-number="21"> <span class="va">officeMarker</span>.<span class="at">setMap</span>(map)<span class="op">;</span> </a>
<a class="sourceLine" id="cb21-22" data-line-number="22"> <span class="kw">var</span> buildingCoordinates <span class="op">=</span> [</a>
<a class="sourceLine" id="cb21-23" data-line-number="23"> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084498</span><span class="op">,-</span><span class="fl">106.624921</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb21-24" data-line-number="24"> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084558</span><span class="op">,-</span><span class="fl">106.624911</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb21-25" data-line-number="25"> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084566</span><span class="op">,-</span><span class="fl">106.624970</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb21-26" data-line-number="26"> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084609</span><span class="op">,-</span><span class="fl">106.624966</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb21-27" data-line-number="27"> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084544</span><span class="op">,-</span><span class="fl">106.624383</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb21-28" data-line-number="28"> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084438</span><span class="op">,-</span><span class="fl">106.624317</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb21-29" data-line-number="29"> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084384</span><span class="op">,-</span><span class="fl">106.623922</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb21-30" data-line-number="30"> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084164</span><span class="op">,-</span><span class="fl">106.623970</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb21-31" data-line-number="31"> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084214</span><span class="op">,-</span><span class="fl">106.624324</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb21-32" data-line-number="32"> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084214</span><span class="op">,-</span><span class="fl">106.624324</span>)<span class="op">,</span></a>
<a class="sourceLine" id="cb21-33" data-line-number="33"> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084391</span><span class="op">,-</span><span class="fl">106.624284</span>)</a>
<a class="sourceLine" id="cb21-34" data-line-number="34"> ]<span class="op">;</span></a>
<a class="sourceLine" id="cb21-35" data-line-number="35"> <span class="kw">var</span> bldgPoly <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">Polygon</span>(<span class="op">{</span></a>
<a class="sourceLine" id="cb21-36" data-line-number="36"> <span class="dt">paths</span><span class="op">:</span> buildingCoordinates<span class="op">,</span></a>
<a class="sourceLine" id="cb21-37" data-line-number="37"> <span class="dt">strokeColor</span><span class="op">:</span> <span class="st">"#FF0000"</span><span class="op">,</span></a>
<a class="sourceLine" id="cb21-38" data-line-number="38"> <span class="dt">strokeOpacity</span><span class="op">:</span> <span class="fl">0.8</span><span class="op">,</span></a>
<a class="sourceLine" id="cb21-39" data-line-number="39"> <span class="dt">strokeWeight</span><span class="op">:</span> <span class="dv">2</span><span class="op">,</span></a>
<a class="sourceLine" id="cb21-40" data-line-number="40"> <span class="dt">fillColor</span><span class="op">:</span> <span class="st">"#FF0000"</span><span class="op">,</span></a>
<a class="sourceLine" id="cb21-41" data-line-number="41"> <span class="dt">fillOpacity</span><span class="op">:</span> <span class="fl">0.35</span></a>
<a class="sourceLine" id="cb21-42" data-line-number="42"> <span class="op">}</span>)<span class="op">;</span></a>
<a class="sourceLine" id="cb21-43" data-line-number="43"> <span class="va">bldgPoly</span>.<span class="at">setMap</span>(map)<span class="op">;</span></a>
<a class="sourceLine" id="cb21-44" data-line-number="44"> <span class="kw">var</span> classInfoContent <span class="op">=</span> <span class="st">'<div class="infoBox">'</span> <span class="op">+</span></a>
<a class="sourceLine" id="cb21-45" data-line-number="45"> <span class="st">'<p>This is the location for the Geography 485L/585L class</p>'</span> <span class="op">+</span></a>
<a class="sourceLine" id="cb21-46" data-line-number="46"> <span class="st">'</div>'</span></a>
<a class="sourceLine" id="cb21-47" data-line-number="47"> <span class="kw">var</span> classInfoWindow <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">InfoWindow</span>(<span class="op">{</span></a>
<a class="sourceLine" id="cb21-48" data-line-number="48"> <span class="dt">content</span><span class="op">:</span> classInfoContent</a>
<a class="sourceLine" id="cb21-49" data-line-number="49"> <span class="op">}</span>)<span class="op">;</span></a>
<a class="sourceLine" id="cb21-50" data-line-number="50"> <span class="va">google</span>.<span class="va">maps</span>.<span class="va">event</span>.<span class="at">addListener</span>(classroomMarker<span class="op">,</span> <span class="st">'click'</span><span class="op">,</span> <span class="kw">function</span>() <span class="op">{</span></a>
<a class="sourceLine" id="cb21-51" data-line-number="51"> <span class="va">classInfoWindow</span>.<span class="at">open</span>(map<span class="op">,</span>classroomMarker)<span class="op">;</span></a>
<a class="sourceLine" id="cb21-52" data-line-number="52"> <span class="op">}</span>)<span class="op">;</span></a>
<a class="sourceLine" id="cb21-53" data-line-number="53"> <span class="kw">var</span> bldgInfoContent <span class="op">=</span> <span class="st">'<div class="infoBox">'</span> <span class="op">+</span></a>
<a class="sourceLine" id="cb21-54" data-line-number="54"> <span class="st">'<p>This is the location of Bandelier East and West on the UNM Campus</p>'</span> <span class="op">+</span></a>
<a class="sourceLine" id="cb21-55" data-line-number="55"> <span class="st">'<iframe src="https://www.google.com/maps/embed?pb=!1m0!3m2!1sen!2sus!4v1486322485343!6m8!1m7!1sneDc4DwioOJ-TytixzvJEg!2m2!1d35.08459518161192!2d-106.6243050674837!3f207.5327084691508!4f-4.850942482843806!5f0.7820865974627469" width="300" height="225" frameborder="0" style="border:0" allowfullscreen></iframe>'</span> <span class="op">+</span></a>
<a class="sourceLine" id="cb21-56" data-line-number="56"> <span class="st">'</div>'</span></a>
<a class="sourceLine" id="cb21-57" data-line-number="57"> <span class="kw">var</span> bldgInfoWindow <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">InfoWindow</span>(<span class="op">{</span></a>
<a class="sourceLine" id="cb21-58" data-line-number="58"> <span class="dt">content</span><span class="op">:</span> bldgInfoContent</a>
<a class="sourceLine" id="cb21-59" data-line-number="59"> <span class="op">}</span>)<span class="op">;</span></a>
<a class="sourceLine" id="cb21-60" data-line-number="60"> <span class="va">google</span>.<span class="va">maps</span>.<span class="va">event</span>.<span class="at">addListener</span>(bldgPoly<span class="op">,</span> <span class="st">'click'</span><span class="op">,</span> <span class="kw">function</span>() <span class="op">{</span></a>
<a class="sourceLine" id="cb21-61" data-line-number="61"> <span class="kw">var</span> position <span class="op">=</span> <span class="kw">new</span> <span class="va">google</span>.<span class="va">maps</span>.<span class="at">LatLng</span>(<span class="fl">35.084438</span><span class="op">,-</span><span class="fl">106.624317</span>)</a>
<a class="sourceLine" id="cb21-62" data-line-number="62"> <span class="va">bldgInfoWindow</span>.<span class="at">setPosition</span>(position)</a>
<a class="sourceLine" id="cb21-63" data-line-number="63"> <span class="va">bldgInfoWindow</span>.<span class="at">open</span>(map)<span class="op">;</span></a>
<a class="sourceLine" id="cb21-64" data-line-number="64"> <span class="op">}</span>)<span class="op">;</span></a>
<a class="sourceLine" id="cb21-65" data-line-number="65"><span class="op">}</span></a>
<a class="sourceLine" id="cb21-66" data-line-number="66"></a>
<a class="sourceLine" id="cb21-67" data-line-number="67"></a></code></pre></div>
</div>
<hr />
<section>
<div class="license">
<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a><br />This work by <span data-xmlns:cc="http://creativecommons.org/ns#" data-property="cc:attributionName">Karl Benedict</span> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.
</div>
</section>
</body>
</html>