-
Notifications
You must be signed in to change notification settings - Fork 173
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
16 changed files
with
459 additions
and
247 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package com.mapbox.mapboxsdk; | ||
|
||
import android.content.Context; | ||
import android.graphics.Bitmap; | ||
import android.graphics.BitmapFactory; | ||
import android.graphics.drawable.BitmapDrawable; | ||
|
@@ -13,23 +14,29 @@ | |
import java.net.URL; | ||
|
||
public class Marker extends OverlayItem{ | ||
public Marker(String aTitle, String aSnippet, GeoPoint aGeoPoint) { | ||
super(aTitle, aSnippet, aGeoPoint); | ||
//Drawable markerDrawable = ; | ||
//this.setMarker(markerDrawable); | ||
} | ||
private Context context; | ||
|
||
|
||
public Marker(String aUid, String aTitle, String aDescription, GeoPoint aGeoPoint) { | ||
super(aUid, aTitle, aDescription, aGeoPoint); | ||
public Marker(String aTitle, String aDescription, GeoPoint aGeoPoint) { | ||
super(aTitle, aDescription, aGeoPoint); | ||
fromMaki("markerstroked"); | ||
} | ||
public Marker(MapView mv, String aTitle, String aDescription, GeoPoint aGeoPoint) { | ||
super(aTitle, aDescription, aGeoPoint); | ||
context = mv.getContext(); | ||
fromMaki("markerstroked"); | ||
} | ||
|
||
public void fromMaki(String makiString){ | ||
String urlString = "https://raw.github.com/mapbox/maki/gh-pages/renders/"+makiString+"[email protected]"; | ||
this.setMarker(new BitmapDrawable()); | ||
new BitmapLoader().execute(urlString); | ||
|
||
String urlString = makiString+"182x"; | ||
System.out.println(urlString); | ||
int id = context.getResources().getIdentifier(urlString, "drawable", context.getPackageName()); | ||
System.out.println(""+id); | ||
this.setMarker(context.getResources().getDrawable(id)); | ||
//this.setMarker(context.getResources().getDrawable(R.drawable.library182x)); | ||
} | ||
|
||
|
||
class BitmapLoader extends AsyncTask<String, Void,Bitmap> { | ||
|
||
@Override | ||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.