nypl-spacetime / Leaflet.GeotagPhoto

Leaflet plugin for photo geotagging
http://spacetime.nypl.org/Leaflet.GeotagPhoto/examples/camera.html
MIT License
70 stars 22 forks source link

Help needed: How can i use this in angular typescript projects #18

Closed MaddyMastering closed 4 years ago

MaddyMastering commented 4 years ago

I really need to use this library in angular project any help would be appreciated.

tried using declare var L: any; but other leaflet libraries fail when doing this.

it gives error with this configuration var points = { type: 'Feature', properties: { angle: 20 }, geometry: { type: 'GeometryCollection', geometries: [ { type: 'Point', coordinates: [ 6.831243038177491, 52.43470397483283 ] }, { type: 'LineString', coordinates: [ [ 6.831243038177491, 52.43470397483283 ], [ 6.831243038177491, 52.43470397483283 ] ] } ] } };

image

bertspaan commented 4 years ago

It seems you're using an incorrect GeoJSON object to initialize Leaflet.GeotagPhoto.

The following input GeoJSON objects are accepted: https://github.com/nypl-spacetime/field-of-view#api.

Does this work (I can't test it quickly myself right now):

var points = {
  type: 'Feature',
  properties: {
    angle: 20
  },
  geometry: {
    type: 'LineString',
    coordinates: [
      [6.831243, 52.434703],
      [6.831253, 52.434713]
    ]
  }
}