Improve code / xml formatting, #54

This commit is contained in:
Emux
2016-07-12 19:25:33 +03:00
parent e793e8851b
commit 43ca550832
133 changed files with 2803 additions and 2791 deletions

View File

@@ -61,7 +61,7 @@ public class BaseMapActivity extends MapActivity {
}
mBaseLayer = mMap.setBaseMap(mTileSource);
/* set initial position on first run */
/* set initial position on first run */
MapPosition pos = new MapPosition();
mMap.getMapPosition(pos);
if (pos.x == 0.5 && pos.y == 0.5)

View File

@@ -98,8 +98,8 @@ public class BitmapTileMapActivity extends MapActivity {
} else {
//mMapView.map().setMapPosition(p);
p.setScale(2 + (1 << (int) (Math.random() * 13)));
// p.setX((p.getX() + (Math.random() * 4 - 2) / p.getScale()));
// p.setY((p.getY() + (Math.random() * 4 - 2) / p.getScale()));
// p.setX((p.getX() + (Math.random() * 4 - 2) / p.getScale()));
// p.setY((p.getY() + (Math.random() * 4 - 2) / p.getScale()));
p.setX(MercatorProjection.longitudeToX(Math.random() * 180));
p.setY(MercatorProjection.latitudeToY(Math.random() * 60));

View File

@@ -62,9 +62,9 @@ public class JeoIndoorMapActivity extends BaseMapActivity {
showToast("load data");
InputStream is = null;
try {
// File file = new File(Environment.getExternalStorageDirectory()
// .getAbsolutePath(), "osmindoor.json");
// is = new FileInputStream(file);
// File file = new File(Environment.getExternalStorageDirectory()
// .getAbsolutePath(), "osmindoor.json");
// is = new FileInputStream(file);
URL url = new URL(PATH);
URLConnection conn = url.openConnection();
@@ -83,11 +83,11 @@ public class JeoIndoorMapActivity extends BaseMapActivity {
mMap.layers().add(new BuildingLayer(mMap, mBaseLayer));
mMap.layers().add(new LabelLayer(mMap, mBaseLayer));
// mMap.layers().add(new TileGridLayer(mMap));
// String file = Environment.getExternalStorageDirectory().getAbsolutePath();
// VectorDataset data = (VectorDataset) JeoTest.getJsonData(file + "/states.json", true);
// Style style = JeoTest.getStyle();
// mMap.layers().add(new JeoVectorLayer(mMap, data, style));
// mMap.layers().add(new TileGridLayer(mMap));
// String file = Environment.getExternalStorageDirectory().getAbsolutePath();
// VectorDataset data = (VectorDataset) JeoTest.getJsonData(file + "/states.json", true);
// Style style = JeoTest.getStyle();
// mMap.layers().add(new JeoVectorLayer(mMap, data, style));
}
void loadJson(InputStream is) {
@@ -171,7 +171,7 @@ public class JeoIndoorMapActivity extends BaseMapActivity {
protected void onResume() {
super.onResume();
/* ignore saved position */
/* ignore saved position */
//mMap.setMapPosition(49.417, 8.673, 1 << 17);
mMap.setMapPosition(53.5620092, 9.9866457, 1 << 16);
}

View File

@@ -50,7 +50,7 @@ public class MarkerOverlayActivity extends BitmapTileMapActivity
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/* directly load bitmap from resources */
/* directly load bitmap from resources */
Bitmap bitmap = drawableToBitmap(getResources(), R.drawable.marker_poi);
MarkerSymbol symbol;
@@ -59,7 +59,7 @@ public class MarkerOverlayActivity extends BitmapTileMapActivity
else
symbol = new MarkerSymbol(bitmap, 0.5f, 0.5f, false);
/* another option: use some bitmap drawable */
/* another option: use some bitmap drawable */
Drawable d = getResources().getDrawable(R.drawable.ic_launcher);
if (BILLBOARDS)
mFocusMarker = new MarkerSymbol(drawableToBitmap(d),
@@ -91,7 +91,7 @@ public class MarkerOverlayActivity extends BitmapTileMapActivity
protected void onResume() {
super.onResume();
/* ignore saved position */
/* ignore saved position */
mMap.setMapPosition(0, 0, 1 << 2);
}

View File

@@ -70,7 +70,7 @@ public class PathOverlayActivity extends BitmapTileMapActivity {
protected void onResume() {
super.onResume();
/* ignore saved position */
/* ignore saved position */
mMap.setMapPosition(0, 0, 1 << 2);
}

View File

@@ -64,7 +64,7 @@ public class S3DBMapActivity extends BaseMapActivity {
protected void onResume() {
super.onResume();
/* ignore saved position */
/* ignore saved position */
mMap.setMapPosition(53.5620092, 9.9866457, 1 << 16);
}
}

View File

@@ -69,8 +69,8 @@ public class SimpleMapActivity extends BaseMapActivity {
//mMapView.map().setMapPosition(p);
p.setScale(2 + (1 << (int) (Math.random() * 13)));
// p.setX((p.getX() + (Math.random() * 4 - 2) / p.getScale()));
// p.setY((p.getY() + (Math.random() * 4 - 2) / p.getScale()));
// p.setX((p.getX() + (Math.random() * 4 - 2) / p.getScale()));
// p.setY((p.getY() + (Math.random() * 4 - 2) / p.getScale()));
p.setX(MercatorProjection.longitudeToX(Math.random() * 180));
p.setY(MercatorProjection.latitudeToY(Math.random() * 60));

View File

@@ -37,39 +37,39 @@ public class VectorLayerMapActivity extends BaseMapActivity {
VectorLayer vectorLayer = new VectorLayer(mMap);
// Geometry g = new GeomBuilder()
// .point(8.8, 53.1)
// .point()
// .buffer(1)
// .get();
// Geometry g = new GeomBuilder()
// .point(8.8, 53.1)
// .point()
// .buffer(1)
// .get();
//
// vectorLayer.add(new PolygonDrawable(g, defaultStyle()));
// vectorLayer.add(new PolygonDrawable(g, defaultStyle()));
//
// vectorLayer.add(new PointDrawable(53.1, 8.8, Style.builder()
// .setBuffer(0.5)
// .setFillColor(Color.RED)
// .setFillAlpha(0.2)
// .build()));
// vectorLayer.add(new PointDrawable(53.1, 8.8, Style.builder()
// .setBuffer(0.5)
// .setFillColor(Color.RED)
// .setFillAlpha(0.2)
// .build()));
//
// Style.Builder sb = Style.builder()
// .setBuffer(0.5)
// .setFillColor(Color.RED)
// .setFillAlpha(0.2);
// Style.Builder sb = Style.builder()
// .setBuffer(0.5)
// .setFillColor(Color.RED)
// .setFillAlpha(0.2);
//
// Style style = sb.setFillAlpha(0.2).build();
// Style style = sb.setFillAlpha(0.2).build();
//
// int tileSize = 5;
// for (int x = -180; x < 180; x += tileSize) {
// for (int y = -90; y < 90; y += tileSize) {
// // Style style = sb.setFillAlpha(FastMath.clamp(FastMath.length(x, y) / 180, 0.2, 1))
// // .build();
// int tileSize = 5;
// for (int x = -180; x < 180; x += tileSize) {
// for (int y = -90; y < 90; y += tileSize) {
// // Style style = sb.setFillAlpha(FastMath.clamp(FastMath.length(x, y) / 180, 0.2, 1))
// // .build();
//
// vectorLayer.add(new RectangleDrawable(FastMath.clamp(y, -85, 85), x,
// FastMath.clamp(y + tileSize - 0.1, -85, 85),
// x + tileSize - 0.1, style));
// vectorLayer.add(new RectangleDrawable(FastMath.clamp(y, -85, 85), x,
// FastMath.clamp(y + tileSize - 0.1, -85, 85),
// x + tileSize - 0.1, style));
//
// }
// }
// }
// }
Style.Builder sb = Style.builder()
.buffer(0.5)