-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pridany GPX tacky pro testovani. Detekce dobehnuti do cile pro usera
- Loading branch information
Showing
8 changed files
with
191 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<gpx xmlns="http://www.topografix.com/GPX/1/1" version="1.1" creator="TrekView - http://www.trekview.cz/"><wpt lat="50.08501395897328" lon="14.512317180633545"><name>1</name></wpt><wpt lat="50.08530309284275" lon="14.513239860534668"><name>2</name></wpt><wpt lat="50.08546831141366" lon="14.513797760009766"><name>3</name></wpt><wpt lat="50.085151641985775" lon="14.514291286468506"><name>4</name></wpt><wpt lat="50.08487627556527" lon="14.514763355255127"><name>5</name></wpt><wpt lat="50.08477989694439" lon="14.51568603515625"><name>6</name></wpt><wpt lat="50.08477989694439" lon="14.516286849975586"><name>7</name></wpt><wpt lat="50.08471105495364" lon="14.51744556427002"><name>8</name></wpt><wpt lat="50.08476612855413" lon="14.518153667449951"><name>9</name></wpt><wpt lat="50.084628444434266" lon="14.51869010925293"><name>10</name></wpt><wpt lat="50.08442191751289" lon="14.51918363571167"><name>11</name></wpt><wpt lat="50.0838298687399" lon="14.520385265350342"><name>12</name></wpt><wpt lat="50.08349941973336" lon="14.520578384399414"><name>13</name></wpt><wpt lat="50.083471882213324" lon="14.521071910858154"><name>14</name></wpt><wpt lat="50.08340303834402" lon="14.523067474365234"><name>15</name></wpt><wpt lat="50.08337550076859" lon="14.524397850036621"><name>16</name></wpt><wpt lat="50.08336173197496" lon="14.526135921478271"><name>Finish</name></wpt></gpx> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?xml version="1.0"?> | ||
<gpx version="1.1" | ||
creator="Marengo Route Creator - http://www.marengo-ltd.com/map/" | ||
xmlns="http://www.topografix.com/GPX/1/1" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 | ||
http://www.topografix.com/GPX/1/1/gpx.xsd"> | ||
<trk> | ||
<name>New Route</name> | ||
<trkseg> | ||
<trkpt lat="50.08530309284275" lon="14.513046741485596"> | ||
<name>Start</name> | ||
<time>2009-10-17T18:37:26Z</time> | ||
</trkpt> | ||
<trkpt lat="50.085427006824325" lon="14.513883590698242"> | ||
<name>1</name> | ||
<time>2009-10-17T18:38:26Z</time> | ||
</trkpt> | ||
<trkpt lat="50.085206715080055" lon="14.514291286468506"> | ||
<name>2</name> | ||
<time>2009-10-17T18:39:26Z</time> | ||
</trkpt> | ||
<trkpt lat="50.084945117318725" lon="14.514656066894531"> | ||
<name>3</name> | ||
<time>2009-10-17T18:40:26Z</time> | ||
</trkpt> | ||
<trkpt lat="50.08479366533065" lon="14.515278339385986"> | ||
<name>4</name> | ||
<time>2009-10-17T18:41:26Z</time> | ||
</trkpt> | ||
<trkpt lat="50.08480743371297" lon="14.515986442565918"> | ||
<name>5</name> | ||
<time>2009-10-17T18:42:26Z</time> | ||
</trkpt> | ||
<trkpt lat="50.08482120209134" lon="14.517059326171875"> | ||
<name>6</name> | ||
<time>2009-10-17T18:43:26Z</time> | ||
</trkpt> | ||
<trkpt lat="50.08471105495364" lon="14.518003463745117"> | ||
<name>7</name> | ||
<time>2009-10-17T18:46:26Z</time> | ||
</trkpt> | ||
<trkpt lat="50.084683518129665" lon="14.518561363220215"> | ||
<name>8</name> | ||
<time>2009-10-17T18:47:26Z</time> | ||
</trkpt> | ||
<trkpt lat="50.08450452838823" lon="14.519033432006836"> | ||
<name>9</name> | ||
<time>2009-10-17T18:48:26Z</time> | ||
</trkpt> | ||
<trkpt lat="50.08433930649519" lon="14.519484043121338"> | ||
<name>10</name> | ||
<time>2009-10-17T18:49:26Z</time> | ||
</trkpt> | ||
<trkpt lat="50.08395378653005" lon="14.520213603973389"> | ||
<name>11</name> | ||
<time>2009-10-17T18:50:26Z</time> | ||
</trkpt> | ||
<trkpt lat="50.08371971932418" lon="14.520471096038818"> | ||
<name>12</name> | ||
<time>2009-10-17T18:51:26Z</time> | ||
</trkpt> | ||
<trkpt lat="50.08352695723759" lon="14.520556926727295"> | ||
<name>End</name> | ||
<time>2009-10-17T18:52:26Z</time> | ||
</trkpt> | ||
</trkseg> | ||
</trk> | ||
</gpx> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* To change this template, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package cz.cvut.fel.nur.zavody; | ||
|
||
import android.app.Application; | ||
import android.location.Location; | ||
import com.google.android.maps.GeoPoint; | ||
|
||
/** | ||
* | ||
* @author saljack | ||
*/ | ||
public class Zavody extends Application { | ||
|
||
/** | ||
* Finish position | ||
*/ | ||
public static final int LATITUDE = (int) (14.5205569 * 1E6); | ||
public static final int LONGITUDE = (int) (50.08352695 * 1E6); | ||
public static final int MIN_DISTANCE = 15;//meters | ||
private GeoPoint _finishGeoPoint; | ||
// private Location _finishLocation; | ||
|
||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
setFinish(new GeoPoint(LONGITUDE, LATITUDE)); | ||
} | ||
|
||
public void setFinish(GeoPoint point) { | ||
_finishGeoPoint = point; | ||
// _finishLocation = new Location("Finish"); | ||
// _finishLocation.setLatitude(point.getLatitudeE6() / 1E6); | ||
// _finishLocation.setLongitude(point.getLongitudeE6() / 1E6); | ||
} | ||
|
||
public GeoPoint getFinishGeoPoint() { | ||
return _finishGeoPoint; | ||
} | ||
|
||
// public Location getFinishLocation() { | ||
// return _finishLocation; | ||
// } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* To change this template, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package cz.cvut.fel.nur.zavody.maps; | ||
|
||
import android.content.Context; | ||
import android.graphics.Canvas; | ||
import android.location.Location; | ||
import android.widget.Toast; | ||
import com.google.android.maps.GeoPoint; | ||
import com.google.android.maps.MapView; | ||
import com.google.android.maps.MyLocationOverlay; | ||
import cz.cvut.fel.nur.zavody.Zavody; | ||
|
||
/** | ||
* | ||
* @author saljack | ||
*/ | ||
public class UserOverlay extends MyLocationOverlay { | ||
|
||
private MapView _view; | ||
private Context _ctx; | ||
|
||
public UserOverlay(Context ctx, MapView mapView) { | ||
super(ctx, mapView); | ||
_view = mapView; | ||
_ctx = ctx; | ||
} | ||
|
||
@Override | ||
public synchronized void onLocationChanged(Location location) { | ||
super.onLocationChanged(location); | ||
int lat = (int) (location.getLatitude() * 1E6); | ||
int lng = (int) (location.getLongitude() * 1E6); | ||
GeoPoint point = new GeoPoint(lat, lng); | ||
|
||
if (_view != null) { | ||
_view.getController().animateTo(point); | ||
} | ||
|
||
GeoPoint finish = ((Zavody) _ctx.getApplicationContext()).getFinishGeoPoint(); | ||
float[] dist = new float[1]; | ||
Location.distanceBetween(finish.getLatitudeE6() / 1E6, finish.getLongitudeE6() / 1E6, location.getLatitude(), location.getLongitude(), dist); | ||
if (dist[0] < Zavody.MIN_DISTANCE) { | ||
Toast.makeText(_ctx, "You win!", Toast.LENGTH_LONG).show(); | ||
} | ||
|
||
} | ||
|
||
@Override | ||
protected void drawMyLocation(Canvas canvas, MapView mapView, Location lastFix, GeoPoint myLocation, long when) { | ||
super.drawMyLocation(canvas, mapView, lastFix, myLocation, when); | ||
|
||
} | ||
} |