Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. callbackEventbrite(function(result){
  2. console.log("env", result)
  3. //var geo = GeoJSON.parse(result.events,{Point: [result.location.latitude, result.location.longitude]});
  4. //console.log(geo);
  5. const keys = Object.values(result);
  6. for(const key of keys){
  7. geojson = {
  8. type: 'featureCollection',
  9. features: [{
  10. type: 'feature',
  11. geometry: {
  12. type: 'Point',
  13. coordinates: [key.venue.longitude, key.venue.latitude]
  14. }
  15. }]
  16. }
  17. eventInfo.push(
  18. {"longitude": key.venue.longitude , "latitude": key.venue.latitude , "name": key.name.text, "venue": key.venue.name, "date": key.start.local, "category": key.category_id}
  19. );
  20.  
  21. }
  22. });
  23.  
  24. function callbackEventbrite(callback){
  25. $.ajax(briteSettings).done(function(data){
  26. callback(data.events);
  27. });
  28. }
  29. // What Iv'e got to work (hard coded data)
  30. map.on("load", function(){
  31. map.addLayer({
  32. "id": "locations",
  33. "type": "symbol",
  34. "source": {
  35. "type": "geojson",
  36. "data": {
  37. "type": "FeatureCollection",
  38. "features": [
  39. {
  40. "type": "Feature",
  41. "properties": {
  42. "Title": "The Congress Inn",
  43. "Description": "Pub located in Longton",
  44. "Type": "Pub",
  45. "Address": "14 Sutherland Rd, Stoke-on-Trent ST3 1HJ",
  46. "Longitude": 2.1316,
  47. "Latitude": 52.9878,
  48. "icon": "bar"
  49. },
  50. "geometry": {
  51. "coordinates": [
  52. -2.131836,
  53. 52.987238
  54. ],
  55. "type": "Point"
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement