| Total Complexity | 4 |
| Complexity/F | 1 |
| Lines of Code | 28 |
| Function Count | 4 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { setUpMap, addPhotos } from './map'; |
||
| 2 | |||
| 3 | const $ = require('jquery'); |
||
| 4 | |||
| 5 | $(() => { |
||
| 6 | const map = setUpMap({ |
||
| 7 | scrollWheelZoom: false, |
||
| 8 | }); |
||
| 9 | |||
| 10 | map.fireEvent('dataloading'); |
||
| 11 | $.getJSON('/api/images', (images) => { |
||
| 12 | const photos = []; |
||
| 13 | images.forEach((image) => { |
||
| 14 | photos.push({ |
||
| 15 | lat: image.latlng[0], |
||
| 16 | lng: image.latlng[1], |
||
| 17 | url: image.mediumImageUri, |
||
| 18 | caption: image.title || '', |
||
| 19 | thumbnail: image.markerImageUri, |
||
| 20 | imageShowUri: image.imageShowUri, |
||
| 21 | }); |
||
| 22 | }); |
||
| 23 | addPhotos(map, photos); |
||
| 24 | }) |
||
| 25 | .always(() => { |
||
| 26 | map.fireEvent('dataload'); |
||
| 27 | }); |
||
| 28 | }); |
||
| 29 |