Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field Paper Atlas Integration #145

Merged
merged 12 commits into from
Apr 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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