PageSourceSearch

https://oneoptimumlifestyles.com/myaccountv2/assets/js/mapbox.js

js oneoptimumlifestyles.com collected 2026-10-02 16:04:23 UTC 9,237 bytes, 176 lines download raw bytes

1
2    // TO MAKE THE MAP APPEAR YOU MUST
3    // ADD YOUR ACCESS TOKEN FROM
4    // https://account.mapbox.com
5var element = document.getElementById('mapbox-chart');
6if (typeof(element) != 'undefined' && element != null)
7{
8    mapboxgl.accessToken = 'pk.eyJ1IjoiYW51cmFnLTAyMDgiLCJhIjoiY2tneGtrbjQxMGt2djJ6cjFveTd5czZwMSJ9.OczAfkRnEysA5zDlBy9eGA';
9    var map = new mapboxgl.Map({
10        container: 'mapbox-chart',
11        style: 'mapbox://styles/mapbox/streets-v11',
12        center: [-77.04, 38.907],
13        zoom: 11.15
14    });
15
16    map.on('load', function () {
17        map.loadImage(
18            'https://docs.mapbox.com/mapbox-gl-js/assets/custom_marker.png',
19            // Add an image to use as a custom marker
20            function (error, image) {
21                if (error) throw error;
22                map.addImage('custom-marker', image);
23
24                map.addSource('places', {
25                    'type': 'geojson',
26                    'data': {
27                        'type': 'FeatureCollection',
28                        'features': [
29                            {
30                                'type': 'Feature',
31                                'properties': {
32                                    'description':
33                                        '<strong>Make it Mount Pleasant</strong><p>Make it Mount Pleasant is a handmade and vintage market and afternoon of live entertainment and kids activities. 12:00-6:00 p.m.</p>'
34                                },
35                                'geometry': {
36                                    'type': 'Point',
37                                    'coordinates': [-77.038659, 38.931567]
38                                }
39                            },
40                            {
41                                'type': 'Feature',
42                                'properties': {
43                                    'description':
44                                        '<strong>Mad Men Season Five Finale Watch Party</strong><p>Head to Lounge 201 (201 Massachusetts Avenue NE) Sunday for a Mad Men Season Five Finale Watch Party, complete with 60s costume contest, Mad Men trivia, and retro food and drink. 8:00-11:00 p.m. $10 general admission, $20 admission and two hour open bar.</p>'
45                                },
46                                'geometry': {
47                                    'type': 'Point',
48                                    'coordinates': [-77.003168, 38.894651]
49                                }
50                            },
51                            {
52                                'type': 'Feature',
53                                'properties': {
54                                    'description':
55                                        '<strong>Big Backyard Beach Bash and Wine Fest</strong><p>EatBar (2761 Washington Boulevard Arlington VA) is throwing a Big Backyard Beach Bash and Wine Fest on Saturday, serving up conch fritters, fish tacos and crab sliders, and Red Apron hot dogs. 12:00-3:00 p.m. $25.</p>'
56                                },
57                                'geometry': {
58                                    'type': 'Point',
59                                    'coordinates': [-77.090372, 38.881189]
60                                }
61                            },
62                            {
63                                'type': 'Feature',
64                                'properties': {
65                                    'description':
66                                        '<strong>Ballston Arts & Crafts Market</strong><p>The Ballston Arts & Crafts Market sets up shop next to the Ballston metro this Saturday for the first of five dates this summer. Nearly 35 artists and crafters will be on hand selling their wares. 10:00-4:00 p.m.</p>'
67                                },
68                                'geometry': {
69                                    'type': 'Point',
70                                    'coordinates': [-77.111561, 38.882342]
71                                }
72                            },
73                            {
74                                'type': 'Feature',
75                                'properties': {
76                                    'description':
77                                        "<strong>Seersucker Bike Ride and Social</strong><p>Feeling dandy? Get fancy, grab your bike, and take part in this year's Seersucker Social bike ride from Dandies and Quaintrelles. After the ride enjoy a lawn party at Hillwood with jazz, cocktails, paper hat-making, and more. 11:00-7:00 p.m.</p>"
78                                },
79                                'geometry': {
80                                    'type': 'Point',
81                                    'coordinates': [-77.052477, 38.943951]
82                                }
83                            },
84                            {
85                                'type': 'Feature',
86                                'properties': {
87                                    'description':
88                                        '<strong>Capital Pride Parade</strong><p>The annual Capital Pride Parade makes its way through Dupont this Saturday. 4:30 p.m. Free.</p>'
89                                },
90                                'geometry': {
91                                    'type': 'Point',
92                                    'coordinates': [-77.043444, 38.909664]
93                                }
94                            },
95                            {
96                                'type': 'Feature',
97                                'properties': {
98                                    'description':
99                                        '<strong>Muhsinah</strong><p>Jazz-influenced hip hop artist Muhsinah plays the Black Cat (1811 14th Street NW) tonight with Exit Clov and Gods’illa. 9:00 p.m. $12.</p>'
100                                },
101                                'geometry': {
102                                    'type': 'Point',
103                                    'coordinates': [-77.031706, 38.914581]
104                                }
105                            },
106                            {
107                                'type': 'Feature',
108                                'properties': {
109                                    'description':
110                                        "<strong>A Little Night Music</strong><p>The Arlington Players' production of Stephen Sondheim's <em>A Little Night Music</em> comes to the Kogod Cradle at The Mead Center for American Theater (1101 6th Street SW) this weekend and next. 8:00 p.m.</p>"
111                                },
112                                'geometry': {
113                                    'type': 'Point',
114                                    'coordinates': [-77.020945, 38.878241]
115                                }
116                            },
117                            {
118                                'type': 'Feature',
119                                'properties': {
120                                    'description':
121                                        '<strong>Truckeroo</strong><p>Truckeroo brings dozens of food trucks, live music, and games to half and M Street SE (across from Navy Yard Metro Station) today from 11:00 a.m. to 11:00 p.m.</p>'
122                                },
123                                'geometry': {
124                                    'type': 'Point',
125                                    'coordinates': [-77.007481, 38.876516]
126                                }
127                            }
128                        ]
129                    }
130                });
131
132                // Add a layer showing the places.
133                map.addLayer({
134                    'id': 'places',
135                    'type': 'symbol',
136                    'source': 'places',
137                    'layout': {
138                        'icon-image': 'custom-marker',
139                        'icon-allow-overlap': true
140                    }
141                });
142            }
143        );
144
145        // Create a popup, but don't add it to the map yet.
146        var popup = new mapboxgl.Popup({
147            closeButton: false,
148            closeOnClick: false
149        });
150
151        map.on('mouseenter', 'places', function (e) {
152            // Change the cursor style as a UI indicator.
153            map.getCanvas().style.cursor = 'pointer';
154
155            var coordinates = e.features[0].geometry.coordinates.slice();
156            var description = e.features[0].properties.description;
157
158            // Ensure that if the map is zoomed out such that multiple
159            // copies of the feature are visible, the popup appears
160            // over the copy being pointed to.
161            while (Math.abs(e.lngLat.lng - coordinates[0]) > 180) {
162                coordinates[0] += e.lngLat.lng > coordinates[0] ? 360 : -360;
163            }
164
165            // Populate the popup and set its coordinates
166            // based on the feature found.
167            popup.setLngLat(coordinates).setHTML(description).addTo(map);
168        });
169
170        map.on('mouseleave', 'places', function () {
171            map.getCanvas().style.cursor = '';
172            popup.remove();
173        });
174    });
175}
176	

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.