- remove swrenderer

- rearchitect:
 now that MapView is a ViewGroup and MapRenderer is the GLSurfaceView.
- lock/unlock proxy tiles properly to not be removed from cache while in use
This commit is contained in:
Hannes Janetzek
2012-09-16 19:26:53 +02:00
parent caea9cd7c9
commit a1317a9de5
81 changed files with 5271 additions and 5408 deletions

View File

@@ -14,7 +14,6 @@
*/
package org.oscim.core;
/**
* A GeoPoint represents an immutable pair of latitude and longitude coordinates.
*/
@@ -119,10 +118,10 @@ public class GeoPoint implements Comparable<GeoPoint> {
@Override
public String toString() {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("GeoPoint [latitudeE6=");
stringBuilder.append(this.latitudeE6);
stringBuilder.append(", longitudeE6=");
stringBuilder.append(this.longitudeE6);
stringBuilder.append("GeoPoint [lat=");
stringBuilder.append(this.getLatitude());
stringBuilder.append(", lon=");
stringBuilder.append(this.getLongitude());
stringBuilder.append("]");
return stringBuilder.toString();
}

View File

@@ -1,57 +0,0 @@
/*
* Copyright 2010, 2011, 2012 mapsforge.org
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.core;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* An LRUCache with a fixed size and an access-order policy. Old mappings are automatically removed from the cache when
* new mappings are added. This implementation uses an {@link LinkedHashMap} internally.
*
* @param <K>
* the type of the map key, see {@link Map}.
* @param <V>
* the type of the map value, see {@link Map}.
*/
public class LRUCache<K, V> extends LinkedHashMap<K, V> {
private static final float LOAD_FACTOR = 0.6f;
private static final long serialVersionUID = 1L;
private static int calculateInitialCapacity(int capacity) {
if (capacity < 0) {
throw new IllegalArgumentException("capacity must not be negative: " + capacity);
}
return (int) (capacity / LOAD_FACTOR) + 2;
}
private final int capacity;
/**
* @param capacity
* the maximum capacity of this cache.
* @throws IllegalArgumentException
* if the capacity is negative.
*/
public LRUCache(int capacity) {
super(calculateInitialCapacity(capacity), LOAD_FACTOR, true);
this.capacity = capacity;
}
@Override
protected boolean removeEldestEntry(Map.Entry<K, V> eldest) {
return size() > this.capacity;
}
}

View File

@@ -22,22 +22,22 @@ public class Tag {
/**
* The key of the house number OpenStreetMap tag.
*/
public static final String TAG_KEY_HOUSE_NUMBER = "addr:housenumber";
public static final String TAG_KEY_HOUSE_NUMBER = "addr:housenumber".intern();
/**
* The key of the name OpenStreetMap tag.
*/
public static final String TAG_KEY_NAME = "name";
public static final String TAG_KEY_NAME = "name".intern();
/**
* The key of the reference OpenStreetMap tag.
*/
public static final String TAG_KEY_REF = "ref";
public static final String TAG_KEY_REF = "ref".intern();
/**
* The key of the elevation OpenStreetMap tag.
*/
public static final String TAG_KEY_ELE = "ele";
public static final String TAG_KEY_ELE = "ele".intern();
/**
* The key of this tag.
@@ -102,8 +102,8 @@ public class Tag {
this.value = (value == null ? null : value.intern());
}
else {
this.key = (key == null ? null : key);
this.value = (value == null ? null : value);
this.key = key;
this.value = value;
}
}