Advertisement
Guest User

Untitled

a guest
Jun 30th, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. Can i save the features on selecting points into same json file?
  2.  
  3. draw.on('drawend',
  4. function(evt) {
  5. console.log(evt.feature);
  6. var parser = new ol.format.GeoJSON();
  7. var features = floodAlertLayer.getSource().getFeatures();
  8. var featuresGeoJSON = parser.writeFeatures(features);
  9. var text = JSON.stringify(featuresGeoJSON);
  10. // document.getElementById('info').innerHTML = text;
  11. // alert(features.get("COUNTY"));
  12. $.ajax({
  13. url: 'FloodAlert.json',
  14. type: 'POST',
  15.  
  16. data: text
  17.  
  18.  
  19. }).then(function(response) {
  20. console.log(response);
  21. });
  22. },
  23. this);
  24. }`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement