-
Notifications
You must be signed in to change notification settings - Fork 23
/
index.js
45 lines (38 loc) · 1.21 KB
/
index.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
'use strict'
import L from 'Leaflet'
import GeotagPhotoCrosshair from './src/Leaflet.GeotagPhoto.Crosshair'
import GeotagPhotoCamera from './src/Leaflet.GeotagPhoto.Camera'
// Object.assign polyfill, for IE<=11. From:
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Polyfill
// TODO: I'm sure Babel can add this polyfill, too.
if (typeof Object.assign !== 'function') {
Object.assign = function (target, varArgs) {
if (target == null) {
throw new TypeError('Cannot convert undefined or null to object')
}
var to = Object(target)
for (var index = 1; index < arguments.length; index++) {
var nextSource = arguments[index]
if (nextSource != null) {
for (var nextKey in nextSource) {
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
to[nextKey] = nextSource[nextKey]
}
}
}
}
return to
}
}
L.geotagPhoto = {
crosshair: function (options) {
return new GeotagPhotoCrosshair(options)
},
camera: function (feature, options) {
return new GeotagPhotoCamera(feature, options)
}
}
L.GeotagPhoto = {
Crosshair: GeotagPhotoCrosshair,
Camera: GeotagPhotoCamera
}