Improve code / xml formatting, #54
This commit is contained in:
@@ -116,10 +116,10 @@ public class JtsPathLayer extends VectorLayer {
|
||||
public void addGreatCircle(GeoPoint startPoint, GeoPoint endPoint) {
|
||||
synchronized (mPoints) {
|
||||
|
||||
/* get the great circle path length in meters */
|
||||
/* get the great circle path length in meters */
|
||||
double length = startPoint.distanceTo(endPoint);
|
||||
|
||||
/* add one point for every 100kms of the great circle path */
|
||||
/* add one point for every 100kms of the great circle path */
|
||||
int numberOfPoints = (int) (length / 100000);
|
||||
|
||||
addGreatCircle(startPoint, endPoint, numberOfPoints);
|
||||
@@ -137,12 +137,12 @@ public class JtsPathLayer extends VectorLayer {
|
||||
final int numberOfPoints) {
|
||||
/* adapted from page
|
||||
* http://compastic.blogspot.co.uk/2011/07/how-to-draw-great-circle-on-map
|
||||
* -in.html
|
||||
* which was adapted from page http://maps.forum.nu/gm_flight_path.html */
|
||||
* -in.html
|
||||
* which was adapted from page http://maps.forum.nu/gm_flight_path.html */
|
||||
|
||||
GeomBuilder gb = new GeomBuilder();
|
||||
|
||||
/* convert to radians */
|
||||
/* convert to radians */
|
||||
double lat1 = startPoint.getLatitude() * Math.PI / 180;
|
||||
double lon1 = startPoint.getLongitude() * Math.PI / 180;
|
||||
double lat2 = endPoint.getLatitude() * Math.PI / 180;
|
||||
|
||||
@@ -88,7 +88,7 @@ public class VectorLayer extends AbstractVectorLayer<Drawable> {
|
||||
Envelope e = geometry.getEnvelopeInternal();
|
||||
Box bbox = new Box(e.getMinX(), e.getMinY(), e.getMaxX(), e.getMaxY());
|
||||
//if ("Point".equals(geometry.getGeometryType())){
|
||||
// bbox.
|
||||
// bbox.
|
||||
//}
|
||||
|
||||
bbox.scale(1E6);
|
||||
@@ -158,15 +158,15 @@ public class VectorLayer extends AbstractVectorLayer<Drawable> {
|
||||
if (Double.isNaN(bbox.xmin))
|
||||
return;
|
||||
|
||||
// mEnvelope = new GeomBuilder()
|
||||
// .point(bbox.xmin, bbox.ymin)
|
||||
// .point(bbox.xmin, bbox.ymax)
|
||||
// .point(bbox.xmax, bbox.ymax)
|
||||
// .point(bbox.xmax, bbox.ymin)
|
||||
// .point(bbox.xmin, bbox.ymin)
|
||||
// .toPolygon();
|
||||
// mEnvelope = new GeomBuilder()
|
||||
// .point(bbox.xmin, bbox.ymin)
|
||||
// .point(bbox.xmin, bbox.ymax)
|
||||
// .point(bbox.xmax, bbox.ymax)
|
||||
// .point(bbox.xmax, bbox.ymin)
|
||||
// .point(bbox.xmin, bbox.ymin)
|
||||
// .toPolygon();
|
||||
|
||||
/* reduce lines points min distance */
|
||||
/* reduce lines points min distance */
|
||||
mMinX = ((bbox.xmax - bbox.xmin) / mMap.getWidth());
|
||||
mMinY = ((bbox.ymax - bbox.ymin) / mMap.getHeight());
|
||||
|
||||
@@ -177,7 +177,7 @@ public class VectorLayer extends AbstractVectorLayer<Drawable> {
|
||||
int level = 0;
|
||||
Style lastStyle = null;
|
||||
|
||||
/* go through features, find the matching style and draw */
|
||||
/* go through features, find the matching style and draw */
|
||||
synchronized (this) {
|
||||
tmpDrawables.clear();
|
||||
mDrawables.search(bbox, tmpDrawables);
|
||||
@@ -294,13 +294,13 @@ public class VectorLayer extends AbstractVectorLayer<Drawable> {
|
||||
double x = (longitudeToX(px) - pos.x) * scale;
|
||||
double y = (latitudeToY(py) - pos.y) * scale;
|
||||
|
||||
/* TODO in the next line I was only able to interpolate a function
|
||||
/* TODO in the next line I was only able to interpolate a function
|
||||
* that makes up for the zoom level. The circle should not grow, it
|
||||
* should stickto the map. 0.01 / (1 << startLvl) makes it retain
|
||||
* its size. Correction? */
|
||||
* should stickto the map. 0.01 / (1 << startLvl) makes it retain
|
||||
* its size. Correction? */
|
||||
int zoomScale = (1 << style.scalingZoomLevel);
|
||||
|
||||
/* Keep the circle's size constant in relation to the underlying map */
|
||||
/* Keep the circle's size constant in relation to the underlying map */
|
||||
double radius = style.buffer;
|
||||
|
||||
if (pos.scale > zoomScale)
|
||||
|
||||
@@ -41,8 +41,8 @@ public class Style {
|
||||
* <p/>
|
||||
* <pre>
|
||||
* {
|
||||
* Style style = Style.builder()
|
||||
* .strokeWidth(1f).strokeColor(Color.BLACK).build();
|
||||
* Style style = Style.builder()
|
||||
* .strokeWidth(1f).strokeColor(Color.BLACK).build();
|
||||
* }
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user