Skip to content

Commit

Permalink
Merge pull request #145 from AmericanRedCross/fp-overlay
Browse files Browse the repository at this point in the history
Field Paper Atlas Integration
  • Loading branch information
hallahan committed Apr 23, 2016
2 parents d1ec6ba + 9575f58 commit 0242741
Show file tree
Hide file tree
Showing 14 changed files with 520 additions and 25 deletions.
1 change: 1 addition & 0 deletions MapboxAndroidSDK/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dependencies {
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.jakewharton:disklrucache:2.0.2'
compile 'commons-codec:commons-codec:1.10'
compile 'commons-io:commons-io:2.4'
}

android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@
import com.spatialdev.osm.renderer.OSMOverlay;
import com.vividsolutions.jts.geom.Envelope;

import org.fieldpapers.model.FPAtlas;

import java.util.List;

public class OSMMap implements MapViewListener, MapListener {

// DEBUG MODE - SHOW ENVELOPE AROUND TAP ON MAP
private static final boolean DEBUG = true;
private static final boolean DEBUG = false;

private MapView mapView;
private JTSModel jtsModel;
Expand Down Expand Up @@ -124,6 +126,11 @@ public void onLongPressMarker(MapView pMapView, Marker pMarker) {

@Override
public void onTapMap(MapView pMapView, ILatLng pPosition) {
FPAtlas atlas = FPAtlas.singleton();
if (atlas != null) {
atlas.onTapMap(pMapView, pPosition);
}

float zoom = pMapView.getZoomLevel();

OSMElement.deselectAll();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,11 @@ public OSMElement queryFromTap(ILatLng latLng, float zoom) {

}

// Log.i("queryFromTap closestElement", closestElement.toString());
return closestElement;
Geometry closestElementGeom = closestElement.getJTSGeom();
if (closestElementGeom != null && closestElementGeom.intersects(geometryFactory.createPoint(coord))) {
return closestElement;
}
return null;
}

private Envelope createTapEnvelope(Coordinate coord, double lat, double lng, float zoom) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@
public class OSMLine extends OSMPath {

// OSM GREEN
private static final int DEFAULT_A = 125;
private static final int DEFAULT_R = 126;
private static final int DEFAULT_G = 188;
private static final int DEFAULT_B = 111;
private static final float DEFAULT_WIDTH = 13.0f;
public static final int DEFAULT_A = 125;
public static final int DEFAULT_R = 126;
public static final int DEFAULT_G = 188;
public static final int DEFAULT_B = 111;
public static final float DEFAULT_WIDTH = 13.0f;

// GOLD
private static final int DEFAULT_SELECTED_A = 180;
private static final int DEFAULT_SELECTED_R = 255;
private static final int DEFAULT_SELECTED_G = 140;
private static final int DEFAULT_SELECTED_B = 0;
private static final float DEFAULT_SELECTED_WIDTH = 15.0f;
public static final int DEFAULT_SELECTED_A = 180;
public static final int DEFAULT_SELECTED_R = 255;
public static final int DEFAULT_SELECTED_G = 140;
public static final int DEFAULT_SELECTED_B = 0;
public static final float DEFAULT_SELECTED_WIDTH = 15.0f;

// MAROON
private static final int DEFAULT_EDITED_A = 100;
private static final int DEFAULT_EDITED_R = 245;
private static final int DEFAULT_EDITED_G = 17;
private static final int DEFAULT_EDITED_B = 135;
public static final int DEFAULT_EDITED_A = 100;
public static final int DEFAULT_EDITED_R = 245;
public static final int DEFAULT_EDITED_G = 17;
public static final int DEFAULT_EDITED_B = 135;

private float width;
private int a;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.fieldpapers.listeners;

public interface FPListener {

void onMapCenterPageChangeMessage(String msg);

}
Loading

0 comments on commit 0242741

Please sign in to comment.