we are considering are in the same place.
* Connectivity isn't preserved when bringing ways through (e.g. from OSM layer)
* Alt-click on lines from GPX appears to prevent anything from being selected.
* z-ordering - areas in editing layer prevent background layers from being clicked.
-* GPX of a closed shape (i.e. lat/lon are the same at start and end) 'disappears' when simplified
== Tag editing ==
private static function getDistance(ax:Number,ay:Number,bx:Number,by:Number,l:Number,cx:Number,cy:Number):Number {
// l=length of line
// r=proportion along AB line (0-1) of nearest point
- var r:Number=((cx-ax)*(bx-ax)+(cy-ay)*(by-ay))/(l*l);
+ var r:Number;
+ if (l > 0) {
+ r=((cx-ax)*(bx-ax)+(cy-ay)*(by-ay))/(l*l);
+ } else {
+ r=0;
+ }
// now find the length from cx,cy to ax+r*(bx-ax),ay+r*(by-ay)
var px:Number=(ax+r*(bx-ax)-cx);
var py:Number=(ay+r*(by-ay)-cy);