package dk.network42.osmfocus; import java.util.ArrayList; import java.util.List; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Path; import android.util.Log; public class OsmWay extends OsmElement { private static final String TAG = "OsmWay"; protected final ArrayList mNodes; protected boolean mIsClosed = false; protected Path mPath = new Path(); double mLonClose, mLatMercClose; int mCloseStartNode; boolean mIsMultipolyOuter = false; // Drawn as relation multipolygon instead if true OsmWay(final long osmId, final long osmVersion) { super(osmId, osmVersion); mNodes = new ArrayList(); } void addNode(final OsmNode node) { //Log.d(TAG, "id="+mOsmId+": ("+node.getLat()+","+node.getLon()+"), nodes="+mNodes.size()); //mPath.moveTo(node.getX(), node.getY()); mNodes.add(node); } public List getNodes() { return mNodes; } // For screen mapping when db translation is not active public float getX() { return ((float) mLonClose*MapView.prescale); } public float getY() { return ((float) mLatMercClose*MapView.prescale); } public double distTo(double lon, double lat_merc) { int size = mNodes.size(); double dd, dst = Double.POSITIVE_INFINITY; for (int ii=0; ii