forked from Nandini-13/Byte-Hacks-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaps.js
121 lines (112 loc) · 3.69 KB
/
maps.js
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
function initMap() {
// The location of New York City
var nyc = {
lng: -74.0060,
lat: 40.7128
};
// The map, centered at New York City
var map = new google.maps.Map(
document.getElementById('map'), {
zoom: 10,
center: nyc
});
// The marker, positioned at New York City
var marker = new google.maps.Marker({
position: nyc,
map: map
});
map.data.addGeoJson(cities);
map.data.setStyle(function(feature) {
var icon = {
url: "https://cdn3.iconfinder.com/data/icons/bank-map-pointers/512/xxx043-512.png", // url
scaledSize: new google.maps.Size(36, 36)
};
if (feature.getProperty('icon')) {
icon = feature.getProperty('icon');
}
return /** @type {google.maps.Data.StyleOptions} */({
icon: icon
});
});
}
// GeoJSON, describing the locations and names of some tenements in New York City.
const cities = {
type: "FeatureCollection",
features: [
{
type: "Feature",
geometry: { type: "Point", coordinates: [-74.002534, 40.73877] },
properties: { name: "Horatio Street Tenement"}
},
{
type: "Feature",
geometry: { type: "Point", coordinates: [-73.99959, 40.714465] },
properties: { name: "Mulberry Street Tenement" }
},
{
type: "Feature",
geometry: { type: "Point", coordinates: [-74.007964, 40.740295] },
properties: { name: "Washington Street Tenement" }
},
{
type: "Feature",
geometry: { type: "Point", coordinates: [-73.995585, 40.728204] },
properties: { name: "Mercer Street Tenement" }
},
{
type: "Feature",
geometry: { type: "Point", coordinates: [-73.994822, 40.73035] },
properties: { name: "Greene Street Tenement" }
},
{
type: "Feature",
geometry: { type: "Point", coordinates: [-73.986468, 40.742629] },
properties: { name: "Madison Avenue Tenement" }
},
{
type: "Feature",
geometry: { type: "Point", coordinates: [-73.959847, 40.77364] },
properties: { name: "77th Street Tenement" }
},
{
type: "Feature",
geometry: { type: "Point", coordinates: [-73.96389, 40.803232] },
properties: { name: "Amsterdam Avenue Tenement" }
},
{
type: "Feature",
geometry: { type: "Point", coordinates: [-73.920625, 40.623979] },
properties: { name: "East 57th Street Tenement" }
},
{
type: "Feature",
geometry: { type: "Point", coordinates: [-73.793604, 40.71047] },
properties: { name: "169th Street Tenement" }
},
{
type: "Feature",
geometry: { type: "Point", coordinates: [-73.91155, 40.873194] },
properties: { name: "Broadway Street Tenement"}
},
{
type: "Feature",
geometry: { type: "Point", coordinates: [-73.968507, 40.801763] },
properties: { name: "West End Avenue Tenement"}
},
{
type: "Feature",
geometry: { type: "Point", coordinates: [-73.887714, 40.7666] },
properties: { name: "82nd Street Tenement"}
},
{
type: "Feature",
geometry: { type: "Point", coordinates: [-73.997006, 40.717667] },
properties: { name: "Mott Street Tenement"}
},
{
type: "Feature",
geometry: { type:"Point", coordinates: [-73.99468, 40.725947] },
properties: { name: "Bleecker Street Tenement"}
},
]
};