-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathInteractiveMap.html
More file actions
453 lines (444 loc) · 15 KB
/
InteractiveMap.html
File metadata and controls
453 lines (444 loc) · 15 KB
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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Real State</title>
<style>
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {
height: 100%;
}
/* Optional: Makes the sample page fill the window. */
html, body {
height: 100%;
margin: 0;
padding: 0;
}
.firstHeading {
display: block;
font-size: 2em;
margin-top: 0.67em;
margin-bottom: 0.67em;
margin-left: 0;
margin-right: 0;
font-weight: bold;
}
.bodyContent {
display: block;
font-size: 1em;
margin-top: 1.33em;
margin-bottom: 1.33em;
margin-left: 0;
margin-right: 0;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
// This example displays a marker at the center of Australia.
// When the user clicks the marker, an info window opens.
function initMap() {
var map = new google.maps.Map(document.getElementById('map'), {
center: {lat: 39.0119, lng: -98.4842},
zoom: 4,
styles: [
{
"elementType": "geometry",
"stylers": [
{
"color": "#ebe3cd"
}
]
},
{
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#523735"
}
]
},
{
"elementType": "labels.text.stroke",
"stylers": [
{
"color": "#f5f1e6"
}
]
},
{
"featureType": "administrative",
"elementType": "geometry.stroke",
"stylers": [
{
"color": "#c9b2a6"
}
]
},
{
"featureType": "administrative.land_parcel",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "administrative.land_parcel",
"elementType": "geometry.stroke",
"stylers": [
{
"color": "#dcd2be"
}
]
},
{
"featureType": "administrative.land_parcel",
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#ae9e90"
}
]
},
{
"featureType": "administrative.neighborhood",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "landscape.natural",
"elementType": "geometry",
"stylers": [
{
"color": "#dfd2ae"
}
]
},
{
"featureType": "poi",
"elementType": "geometry",
"stylers": [
{
"color": "#dfd2ae"
}
]
},
{
"featureType": "poi",
"elementType": "labels.text",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "poi",
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#93817c"
}
]
},
{
"featureType": "poi.business",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "poi.park",
"elementType": "geometry.fill",
"stylers": [
{
"color": "#a5b076"
}
]
},
{
"featureType": "poi.park",
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#447530"
}
]
},
{
"featureType": "road",
"elementType": "geometry",
"stylers": [
{
"color": "#f5f1e6"
}
]
},
{
"featureType": "road",
"elementType": "labels",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "road",
"elementType": "labels.icon",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "road.arterial",
"elementType": "geometry",
"stylers": [
{
"color": "#fdfcf8"
}
]
},
{
"featureType": "road.arterial",
"elementType": "labels",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "road.highway",
"elementType": "geometry",
"stylers": [
{
"color": "#f8c967"
}
]
},
{
"featureType": "road.highway",
"elementType": "geometry.stroke",
"stylers": [
{
"color": "#e9bc62"
}
]
},
{
"featureType": "road.highway",
"elementType": "labels",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "road.highway.controlled_access",
"elementType": "geometry",
"stylers": [
{
"color": "#e98d58"
}
]
},
{
"featureType": "road.highway.controlled_access",
"elementType": "geometry.stroke",
"stylers": [
{
"color": "#db8555"
}
]
},
{
"featureType": "road.local",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "road.local",
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#806b63"
}
]
},
{
"featureType": "transit",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "transit.line",
"elementType": "geometry",
"stylers": [
{
"color": "#dfd2ae"
}
]
},
{
"featureType": "transit.line",
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#8f7d77"
}
]
},
{
"featureType": "transit.line",
"elementType": "labels.text.stroke",
"stylers": [
{
"color": "#ebe3cd"
}
]
},
{
"featureType": "transit.station",
"elementType": "geometry",
"stylers": [
{
"color": "#dfd2ae"
}
]
},
{
"featureType": "water",
"elementType": "geometry.fill",
"stylers": [
{
"color": "#b9d3c2"
}
]
},
{
"featureType": "water",
"elementType": "labels.text",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "water",
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#92998d"
}
]
}
]
});
var locations = [
["Atlanta", 33.7490, -84.3880, "What, WeWorry?",
"WeWork\'s Widening Girth Raising Concerns About the Impact on Properties, Portfolios and Markets",
'"Moody\'s Withdraws WeWork\'s Credit", "Ratings for Lack of Sufficient Information", "Did You Hear? Colliers\' Kratz Keeps Climbing", "CBRE Group Buys New England Joint-Venture Partner"', 'neg'],
["Nashville", 36.1627, -86.7816, "Nashville to Get its First Airbnb-Branded Apartments",
"Project Follows Newgard Development Group\'s $90M Deal for 328-Unit Olmsted",
'"Updated: City Office Buys 14-Bldg. Creative Office Complex The Quad for $51 Million", "Dallas-Based Firm Acquires Phoenix Multifamily Complex in Value-Add Play", "Local Developer Pays $8.9M for 1.3 Acres in Nashville", "IMT Capital Buys North Los Angeles Apartment Complex for $167 Million"', 'pos'],
["Denver", 39.7392, -104.9903, "Denver-Area Apartment Market Dealing With Crush of New Units",
"Concessions Up, Rent Growth Slower Following Rush of Deliveries", '"Undersupply of Apartments Drives Los Angeles Market", "Chicago\'s Largest Condo Deconversion Signals Post-Recession Push To Rent", " Rent Growth Surging in Boston\'s Pricey Neighborhoods"', 'neg'],
["Boston", 42.3601, -71.0589, "Amazon Narrows HQ2 Search to 20 Markets",
"E-Commerce Giant Includes Many Major Markets but Also a Few Surprises in Running for $5 Billion, 50,000-job HQ in 2018",
'" \'Opportunity Zones\' Mean Some Local Communities Could Benefit More Than Others", "Port of LA Seeks Developer for 87-Acre Marina", "The Transit Factor in Amazon\'s HQ2 Selection Reflects Transportation\'s Growing Economic Development Clout", "HQ2: Where Amazon Goes, Other Companies Follow"', 'pos'],
["Dallas", 32.7767, -96.7970, "Exclusive: Dallas Office Building Could Set Texas Sales Record",
"1900 Pearl, Completed in January, May Be the State\'s Priciest Per Square Foot",
'"Office Tower in Boston\'s Seaport Sells for $450 Million, Large Office Record for 2018", "San Francisco Mayor Calls for Accountability in Shutdown of $2.2 Billion Salesforce Transit Center", "Local Investors Buy AT&T Headquarters Tower in Downtown Dallas"', 'neutral']
];
var infowindow = new google.maps.InfoWindow();
function placeMarker( loc ) {
var latLng = new google.maps.LatLng( loc[1], loc[2]);
var url = '';
if (loc[6] == 'pos'){
url= 'http://maps.google.com/mapfiles/kml/paddle/grn-circle.png'
// This marker is 20 pixels wide by 32 pixels high.
}else if(loc[6] == 'neg'){
url= 'http://maps.google.com/mapfiles/kml/paddle/red-circle.png'
}else{
url = 'http://maps.google.com/mapfiles/kml/paddle/wht-circle.png'
}
var image = {
url : url
}
var marker = new google.maps.Marker({
position : latLng,
map : map,
icon: image
});
var contentString = '<div id="content">'+
'<div id="siteNotice">'+
'</div>'+
'<h1 id="firstHeading" class="firstHeading" style = display: block; font-size: 1.00 em; margin-top: 0.67em; margin-bottom: 0.67em; margin-left: 0; margin-right: 0; font-weight: bold;>' + locations[i][3] + '</h1>'+
'<div class="bodyContent">'+
'<p style = display: block; font-size: 1em; margin-top: 1.33em; margin-bottom: 1.33em; margin-left: 0; margin-right: 0;>' + locations[i][4] + '</p>'+
'<p class="bodyContent" style = display: block; font-size: 1em; margin-top: 1.33em; margin-bottom: 1.33em; margin-left: 0; margin-right: 0;>' + locations[i][5] + '</p>' +
'</div>'+
'</div>';
google.maps.event.addListener(marker, 'mouseover', function() {
infowindow.setContent(contentString);
infowindow.open(map, marker);
});
google.maps.event.addListener(marker, 'mouseout', function(){
infowindow.close(map, marker);
});
}
for(var i=0; i<locations.length; i++) {
placeMarker( locations[i] );
}
// var contentString2 = '<div id="content">'+
// '<div id="siteNotice">'+
// '</div>'+
// '<h1 id="firstHeading" class="firstHeading">Nashville to Get its First Airbnb-Branded Apartments</h1>'+
// '<div id="bodyContent">'+
// '<p>Project Follows Newgard Development Group\'s $90M Deal for 328-Unit Olmsted</p>'+
// '<p>Related Articles: "Updated: City Office Buys 14-Bldg. Creative Office Complex The Quad for $51 Million", "Dallas-Based Firm Acquires Phoenix Multifamily Complex in Value-Add Play",' +
// "Local Developer Pays $8.9M for 1.3 Acres in Nashville" +
// ' "IMT Capital Buys North Los Angeles Apartment Complex for $167 Million"</p>' +
// '</div>'+
// '</div>';
// var infowindow = new google.maps.InfoWindow({
// content: contentString2
// });
// var marker2 = new google.maps.Marker({
// position: {lat: 36.1627, lng: -86.7816},
// map: map,
// title: 'Nashville'
// });
// marker2.addListener('mouseover', function() {
// infowindow.open(map, marker);
// });
// marker2.addListener('mouseout', function() {
// infowindow.close(map, marker);
// });
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCtolc7_8BlJt6aOHsp1bCTHEDCevm9o8c&callback=initMap">
</script>
</body>
</html>