-
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.
- Loading branch information
Showing
6 changed files
with
134 additions
and
8 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,37 @@ | ||
/* | ||
* 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.drawable.Drawable; | ||
import android.util.Log; | ||
import com.google.android.maps.GeoPoint; | ||
import com.google.android.maps.OverlayItem; | ||
import cz.cvut.fel.nur.zavody.R; | ||
|
||
/** | ||
* | ||
* @author saljack | ||
*/ | ||
public class FinishOverlay extends OverlayItem { | ||
|
||
public static final int LATITUDE = (int) (14.516599 * 1E6); | ||
public static final int LONGITUDE = (int) (50.084988 * 1E6); | ||
private Context _ctx; | ||
private Drawable _marker; | ||
|
||
public FinishOverlay(Context ctx) { | ||
super(new GeoPoint(LONGITUDE, LATITUDE), "Opponent", "Opponent position"); | ||
_ctx = ctx; | ||
_marker = _ctx.getResources().getDrawable(R.drawable.finish); | ||
_marker.setBounds(0 - _marker.getIntrinsicWidth() / 2, 0 - _marker.getIntrinsicHeight(), | ||
_marker.getIntrinsicWidth() / 2, 0); | ||
} | ||
|
||
@Override | ||
public Drawable getMarker(int arg0) { | ||
return _marker; | ||
} | ||
} |
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,39 @@ | ||
/* | ||
* 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.drawable.Drawable; | ||
import com.google.android.maps.GeoPoint; | ||
import com.google.android.maps.OverlayItem; | ||
import cz.cvut.fel.nur.zavody.R; | ||
|
||
/** | ||
* | ||
* //testing coordinates Heldova 50°5'5.671"N, 14°30'52.475"E Oponent | ||
* 50°5'4.328"N, 14°30'50.703"E Finish 50°5'7.458"N, 14°30'47.161"E | ||
* | ||
* @author saljack | ||
*/ | ||
public class OpponentOverlay extends OverlayItem { | ||
|
||
public static final int LATITUDE = (int) (14.513599 * 1E6); | ||
public static final int LONGITUDE = (int) (50.084688 * 1E6); | ||
private Context _ctx; | ||
private Drawable _marker; | ||
|
||
public OpponentOverlay(Context ctx) { | ||
super(new GeoPoint(LONGITUDE, LATITUDE), "Opponent", "Opponent position"); | ||
_ctx = ctx; | ||
_marker = _ctx.getResources().getDrawable(R.drawable.opponent); | ||
_marker.setBounds(0 - _marker.getIntrinsicWidth() / 2, 0 - _marker.getIntrinsicHeight(), | ||
_marker.getIntrinsicWidth() / 2, 0); | ||
} | ||
|
||
@Override | ||
public Drawable getMarker(int arg0) { | ||
return _marker; | ||
} | ||
} |
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,49 @@ | ||
/* | ||
* 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.drawable.Drawable; | ||
import com.google.android.maps.ItemizedOverlay; | ||
import com.google.android.maps.OverlayItem; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* | ||
* @author saljack | ||
*/ | ||
public class RaceOverlays extends ItemizedOverlay<OverlayItem> { | ||
|
||
private Context _ctx; | ||
private List<OverlayItem> _items = new ArrayList<OverlayItem>(2); | ||
|
||
public RaceOverlays(Drawable marker, Context ctx) { | ||
super(boundCenterBottom(marker)); | ||
_ctx = ctx; | ||
_items.add(new FinishOverlay(ctx)); | ||
_items.add(new OpponentOverlay(ctx)); | ||
populate(); | ||
} | ||
|
||
public void add(OverlayItem item) { | ||
_items.add(item); | ||
populate(); | ||
} | ||
|
||
@Override | ||
protected OverlayItem createItem(int i) { | ||
// OverlayItem item = _items.get(i); | ||
// Drawable marker = item.getMarker(0); | ||
// boundCenterBottom(marker); | ||
// item.setMarker(marker); | ||
return _items.get(i); | ||
} | ||
|
||
@Override | ||
public int size() { | ||
return _items.size(); | ||
} | ||
} |