geGeom[0] = start.coordinate;
          }
          if (!end) {
            end = createNode(topo, endCoord);
            edgeGeom[edgeGeom.length - 1] = end.coordinate;
          }
          topo.addEdgeNewFaces(start, end, edgeGeom);
        } catch (e) {
          toastr.warning(e.toString());
        }
      }

      var draw = new ol.interaction.Draw({
        type: 'LineString'
      });
      draw.on('drawend', onDrawend);
      map.addInteraction(draw);
      var snap = new ol.interaction.Snap({
   