SHARE
TWEET

Untitled

a guest Jan 12th, 2017 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Controller.prototype.createRoof = function(data){
  2.  
  3.     console.log("CREATED");
  4.     var type = data.layerType,
  5.         layer = data.layer;
  6.  
  7.     layer.addTo(this.viewMap.map);
  8.     //layer._latlngs hat die Koordinaten
  9.     // oder layer.editing.latlngs
  10.     $(layer).on('click', function () {
  11.         if (layer.editing._enabled) {
  12.             layer.editing.disable()
  13.         } else {
  14.             layer.editing.enable()
  15.         }
  16.     });
  17.     this.viewMap.map.removeLayer(layer);
  18.     var latlngs = data.layer.getLatLngs()[0];
  19.     var roof = new Roof();
  20.     roof.setPointsFromList(latlngs);
  21.     roof.calculateOrientation(this);
  22.     this.roof = roof;
  23.     this.drawRoof();
  24. };
RAW Paste Data
Top