Replace LF by CRLF
This commit is contained in:
parent
a2a1113791
commit
f571c8f317
4 changed files with 129 additions and 129 deletions
|
@ -1,14 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="lib" path="lib/bzip2-20090327.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-logging-1.1.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/json-20090211.jar"/>
|
||||
<classpathentry kind="lib" path="lib/h2-latest.jar"/>
|
||||
<classpathentry kind="lib" path="lib/bsh-core-2.0b4.jar"/>
|
||||
<classpathentry kind="lib" path="lib/junidecode-0.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jleveldb-v01.jar"/>
|
||||
<classpathentry kind="lib" path="lib/sqlite-jdbc-3.7.2.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="lib" path="lib/bzip2-20090327.jar"/>
|
||||
<classpathentry kind="lib" path="lib/commons-logging-1.1.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/json-20090211.jar"/>
|
||||
<classpathentry kind="lib" path="lib/h2-latest.jar"/>
|
||||
<classpathentry kind="lib" path="lib/bsh-core-2.0b4.jar"/>
|
||||
<classpathentry kind="lib" path="lib/junidecode-0.1.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jleveldb-v01.jar"/>
|
||||
<classpathentry kind="lib" path="lib/sqlite-jdbc-3.7.2.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/DataExtractionOSM/src/net/osmand/swing/OsmExtractionUI.java"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="net.osmand.swing.OsmExtractionUI"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="DataExtractionOSM"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-XX:+UseParallelGC -Xmx640M -Xmn256M"/>
|
||||
</launchConfiguration>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/DataExtractionOSM/src/net/osmand/swing/OsmExtractionUI.java"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="net.osmand.swing.OsmExtractionUI"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="DataExtractionOSM"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-XX:+UseParallelGC -Xmx640M -Xmn256M"/>
|
||||
</launchConfiguration>
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
package net.osmand;
|
||||
|
||||
import android.location.Location;
|
||||
|
||||
public class LatLonUtils {
|
||||
|
||||
public static Location middleLocation(Location start, Location end,
|
||||
float meters) {
|
||||
double lat1 = toRad(start.getLatitude());
|
||||
double lon1 = toRad(start.getLongitude());
|
||||
double R = 6371; // radius of earth in km
|
||||
double d = meters / 1000; // in km
|
||||
float brng = (float) (toRad(start.bearingTo(end)));
|
||||
double lat2 = Math.asin(Math.sin(lat1) * Math.cos(d / R)
|
||||
+ Math.cos(lat1) * Math.sin(d / R) * Math.cos(brng));
|
||||
double lon2 = lon1
|
||||
+ Math.atan2(Math.sin(brng) * Math.sin(d / R) * Math.cos(lat1),
|
||||
Math.cos(d / R) - Math.sin(lat1) * Math.sin(lat2));
|
||||
Location nl = new Location(start);
|
||||
nl.setLatitude(toDegree(lat2));
|
||||
nl.setLongitude(toDegree(lon2));
|
||||
nl.setBearing(brng);
|
||||
return nl;
|
||||
}
|
||||
|
||||
private static double toDegree(double radians) {
|
||||
return radians * 180 / Math.PI;
|
||||
}
|
||||
|
||||
private static double toRad(double degree) {
|
||||
return degree * Math.PI / 180;
|
||||
}
|
||||
|
||||
}
|
||||
package net.osmand;
|
||||
|
||||
import android.location.Location;
|
||||
|
||||
public class LatLonUtils {
|
||||
|
||||
public static Location middleLocation(Location start, Location end,
|
||||
float meters) {
|
||||
double lat1 = toRad(start.getLatitude());
|
||||
double lon1 = toRad(start.getLongitude());
|
||||
double R = 6371; // radius of earth in km
|
||||
double d = meters / 1000; // in km
|
||||
float brng = (float) (toRad(start.bearingTo(end)));
|
||||
double lat2 = Math.asin(Math.sin(lat1) * Math.cos(d / R)
|
||||
+ Math.cos(lat1) * Math.sin(d / R) * Math.cos(brng));
|
||||
double lon2 = lon1
|
||||
+ Math.atan2(Math.sin(brng) * Math.sin(d / R) * Math.cos(lat1),
|
||||
Math.cos(d / R) - Math.sin(lat1) * Math.sin(lat2));
|
||||
Location nl = new Location(start);
|
||||
nl.setLatitude(toDegree(lat2));
|
||||
nl.setLongitude(toDegree(lon2));
|
||||
nl.setBearing(brng);
|
||||
return nl;
|
||||
}
|
||||
|
||||
private static double toDegree(double radians) {
|
||||
return radians * 180 / Math.PI;
|
||||
}
|
||||
|
||||
private static double toRad(double degree) {
|
||||
return degree * Math.PI / 180;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,65 +1,65 @@
|
|||
package net.osmand.plus.activities;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.osmand.LatLonUtils;
|
||||
import android.location.Location;
|
||||
|
||||
public class RouteAnimation {
|
||||
|
||||
private Thread routeAnimation;
|
||||
|
||||
public boolean isRouteAnimating() {
|
||||
return routeAnimation != null;
|
||||
}
|
||||
|
||||
public void startStopRouteAnimation(final RoutingHelper routingHelper,
|
||||
final MapActivity ma) {
|
||||
if (!isRouteAnimating()) {
|
||||
routeAnimation = new Thread() {
|
||||
public void run() {
|
||||
final List<Location> directions = new ArrayList<Location>(
|
||||
routingHelper.getCurrentRoute());
|
||||
Location current = null;
|
||||
float meters = 20.0f;
|
||||
while (!directions.isEmpty() && routeAnimation != null) {
|
||||
if (current == null) {
|
||||
current = new Location(directions.remove(0));
|
||||
} else {
|
||||
if (current.distanceTo(directions.get(0)) > meters) {
|
||||
current = LatLonUtils.middleLocation(current,
|
||||
directions.get(0), meters);
|
||||
} else {
|
||||
current = new Location(directions.remove(0));
|
||||
}
|
||||
}
|
||||
current.setSpeed(meters);
|
||||
current.setTime(System.currentTimeMillis());
|
||||
ma.setLocation(current);
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
RouteAnimation.this.stop();
|
||||
};
|
||||
};
|
||||
routeAnimation.start();
|
||||
} else {
|
||||
// stop the animation
|
||||
stop();
|
||||
}
|
||||
}
|
||||
|
||||
private void stop() {
|
||||
routeAnimation = null;
|
||||
}
|
||||
|
||||
public void close() {
|
||||
if (isRouteAnimating()) {
|
||||
stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
package net.osmand.plus.activities;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.osmand.LatLonUtils;
|
||||
import android.location.Location;
|
||||
|
||||
public class RouteAnimation {
|
||||
|
||||
private Thread routeAnimation;
|
||||
|
||||
public boolean isRouteAnimating() {
|
||||
return routeAnimation != null;
|
||||
}
|
||||
|
||||
public void startStopRouteAnimation(final RoutingHelper routingHelper,
|
||||
final MapActivity ma) {
|
||||
if (!isRouteAnimating()) {
|
||||
routeAnimation = new Thread() {
|
||||
public void run() {
|
||||
final List<Location> directions = new ArrayList<Location>(
|
||||
routingHelper.getCurrentRoute());
|
||||
Location current = null;
|
||||
float meters = 20.0f;
|
||||
while (!directions.isEmpty() && routeAnimation != null) {
|
||||
if (current == null) {
|
||||
current = new Location(directions.remove(0));
|
||||
} else {
|
||||
if (current.distanceTo(directions.get(0)) > meters) {
|
||||
current = LatLonUtils.middleLocation(current,
|
||||
directions.get(0), meters);
|
||||
} else {
|
||||
current = new Location(directions.remove(0));
|
||||
}
|
||||
}
|
||||
current.setSpeed(meters);
|
||||
current.setTime(System.currentTimeMillis());
|
||||
ma.setLocation(current);
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
RouteAnimation.this.stop();
|
||||
};
|
||||
};
|
||||
routeAnimation.start();
|
||||
} else {
|
||||
// stop the animation
|
||||
stop();
|
||||
}
|
||||
}
|
||||
|
||||
private void stop() {
|
||||
routeAnimation = null;
|
||||
}
|
||||
|
||||
public void close() {
|
||||
if (isRouteAnimating()) {
|
||||
stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue