-
Notifications
You must be signed in to change notification settings - Fork 12
/
world_map_llm_func_openai_with_cities.html
93 lines (84 loc) · 3.12 KB
/
world_map_llm_func_openai_with_cities.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
Below is a sample HTML template incorporating Google Maps to place markers on the provided locations for a Ray meetup in San Francisco, New York, and London. To use Google Maps in your HTML, you'll need an API key from the Google Cloud Platform.
```html
<!DOCTYPE html>
<html>
<head>
<title>Ray Meetup Locations</title>
<style>
/* Set the size of the map */
#map {
height: 80%;
width: 100%;
}
/* Style the page */
html, body {
height: 100%;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<h1>Ray Meetup Coordinates</h1>
<div id="map"></div>
<script>
// Function to initialize and add the map
function initMap() {
// Map options
var options = {
zoom: 2,
center: { lat: 40.7128, lng: -74.006 } // Centering the map roughly between the locations
};
// New map
var map = new google.maps.Map(document.getElementById('map'), options);
// Add markers to the map
var markers = [
{
coords: {lat: 37.7749, lng: -122.4194},
content: '<h3>Ray Meetup - San Francisco</h3>'
},
{
coords: {lat: 40.7128, lng: -74.006},
content: '<h3>Ray Meetup - New York</h3>'
},
{
coords: {lat: 51.5074, lng: -0.1276},
content: '<h3>Ray Meetup - London</h3>'
},
];
// Loop through markers
for(var i = 0; i < markers.length; i++){
addMarker(markers[i]);
}
// Add Marker function
function addMarker(props) {
var marker = new google.maps.Marker({
position: props.coords,
map: map,
});
// Check for custom icon
if(props.iconImage){
// Set icon image
marker.setIcon(props.iconImage);
}
// Check for content
if(props.content){
var infoWindow = new google.maps.InfoWindow({
content: props.content
});
marker.addListener('click', function() {
infoWindow.open(map, marker);
});
}
}
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap">
//Replace 'YOUR_API_KEY' with your actual Google Maps API key
</script>
</body>
</html>
```
Please make sure to replace `'YOUR_API_KEY'` with your actual Google Maps API key in the script tag source URL. Without a valid API key, the map will not display correctly.
This HTML document creates a map with zoom settings that should show all three cities on a global scale. Each city has a marker with a popup window containing the name of the city and the event hosted there.