CodeTanzania / emis-alert

A representation of an entity which provides(or receives) disaster notifications to(or from) source(s)
https://codetanzania.github.io/emis-alert/
MIT License
2 stars 1 forks source link

API returns an invalid GeoJson object #6

Closed Mloweedgar closed 5 years ago

Mloweedgar commented 5 years ago

The returned Geojson does not follow specifications mentioned here https://tools.ietf.org/html/rfc7946 , therefore the returned GeoJson cannot be displayed on Map

lykmapipo commented 5 years ago

@Mloweedgar Please share error trace for the bug...

lykmapipo commented 5 years ago

@Mloweedgar You are supposed to use alert.area.geometry and not alert.area to have a geojson to display on the map using leaflet

lykmapipo commented 5 years ago

@Mloweedgar Check this fiddle

Mloweedgar commented 5 years ago

@lykmapipo I can display the GeoJson with some work arounds, however I would prefer to receive a valid GeoJson from backend API. I have been looking at official examples here https://leafletjs.com/examples/geojson/, I have also learnt that createdAt and updatedAt fields are not suppossed to be part of the GeoJSON geometry according this specification https://tools.ietf.org/html/rfc7946. I have displayed the Alerts here https://emis-web-alerts.herokuapp.com/

Mloweedgar commented 5 years ago

@lykmapipo I like that the fake alerts can be displayed with Tanzania boundaries, can you make them cover small areas so that they may look more realistic( the current ones are too big)

lykmapipo commented 5 years ago

@Mloweedgar Sure...createAt and updatedAt are foreign members and will be subjected to removal...