assets/imageclusterpage.js   A
last analyzed

Complexity

Total Complexity 4
Complexity/F 1

Size

Lines of Code 28
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 19
c 0
b 0
f 0
dl 0
loc 28
rs 10
mnd 0
bc 0
fnc 4
bpm 0
cpm 1
noi 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