diff --git a/helloworld/build.gradle b/helloworld/build.gradle index e19670a..9176171 100644 --- a/helloworld/build.gradle +++ b/helloworld/build.gradle @@ -28,5 +28,5 @@ dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.4.0' - compile 'com.mappedin.sdk:mappedin:0.14.0' + compile 'com.mappedin.sdk:mappedin:0.16.0' } diff --git a/singlevenue/build.gradle b/singlevenue/build.gradle index de5fdc0..b5ce3a5 100644 --- a/singlevenue/build.gradle +++ b/singlevenue/build.gradle @@ -29,6 +29,6 @@ dependencies { testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.4.0' compile 'com.android.support.constraint:constraint-layout:1.0.2' - compile 'com.mappedin.sdk:mappedin:0.14.0' + compile 'com.mappedin.sdk:mappedin:0.16.0' compile 'com.koushikdutta.ion:ion:2.+' } diff --git a/singlevenue/src/main/java/com/mappedin/examples/singlevenue/IAmHere.java b/singlevenue/src/main/java/com/mappedin/examples/singlevenue/IAmHere.java index e3a996a..af0c597 100644 --- a/singlevenue/src/main/java/com/mappedin/examples/singlevenue/IAmHere.java +++ b/singlevenue/src/main/java/com/mappedin/examples/singlevenue/IAmHere.java @@ -37,20 +37,11 @@ public void setColor(int arrowColor, int cylinderColor, float over){ arrow.setColor(arrowColor, over); cylinder.setColor(cylinderColor, over); } - public Coordinate[] getFrame(){ + public Coordinate getFrame(){ if (map != null) { - Vector3 position = arrow.getPosition(); - float x = position.getX(); - float y = position.getY(); - float z = position.getZ(); - float offset = 20; - frame = new Coordinate[4]; - frame[0] = new Coordinate(new Vector3(x + offset, y + offset, z), map); - frame[1] = new Coordinate(new Vector3(x + offset, y - offset, z), map); - frame[2] = new Coordinate(new Vector3(x - offset, y + offset, z), map); - frame[3] = new Coordinate(new Vector3(x - offset, y - offset, z), map); + return new Coordinate(arrow.getPosition(), map); } - return frame; + return null; } public void addIAmHere(MapView mapView){ mapView.addElement(arrow); diff --git a/singlevenue/src/main/java/com/mappedin/examples/singlevenue/MainActivity.java b/singlevenue/src/main/java/com/mappedin/examples/singlevenue/MainActivity.java index 24912c1..ad6f4c2 100644 --- a/singlevenue/src/main/java/com/mappedin/examples/singlevenue/MainActivity.java +++ b/singlevenue/src/main/java/com/mappedin/examples/singlevenue/MainActivity.java @@ -102,7 +102,6 @@ public class MainActivity extends ActivityGroup implements MapViewDelegate, Sens private boolean accessibleDirections = false; private boolean walking = false; private boolean autoRotation = false; - private float initialDegree = 0; static final int PICK_CONTACT_REQUEST = 1; // The request code @Override @@ -250,14 +249,15 @@ public void afterTextChanged(Editable editable) { public void onSensorChanged(SensorEvent sensorEvent) { if (autoRotation && iAmHere != null) { float degree = sensorEvent.values[0]; - Coordinate[] frame = iAmHere.getFrame(); - if (frame != null) { - mapView.orbit(iAmHere.frame, - -initialDegree + (float) Math.toRadians(degree), - (float)Math.PI/5, 0); + Coordinate iAmHerePosition = iAmHere.getFrame(); + float padding = 20; + if (iAmHerePosition != null) { + mapView.orbit(iAmHerePosition, + (float) Math.toRadians(degree), + (float)Math.PI/5, 0, padding); } if(iAmHere != null) { - iAmHere.setRotation(initialDegree - (float) Math.toRadians(degree), 0); + iAmHere.setRotation((float) Math.toRadians(degree), 0); } } } @@ -671,7 +671,7 @@ else if (y1 == y2){ angel = (float)Math.PI + angel; } } - iAmHere.setRotation(-angel, 0); + iAmHere.setRotation(angel, 0); } try { float distance = currInstruction.coordinate.metersFrom(coordinate);