This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add 1 hole support to polygon-related classes * fix no hole crash and add triangle hole shape example * add support for multiple holes
- Loading branch information
1 parent
1d33bf7
commit b71d865
Showing
8 changed files
with
208 additions
and
5 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Hole.java
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,53 @@ | ||
package com.mapbox.mapboxsdk.annotations; | ||
|
||
|
||
import android.os.Parcel; | ||
import android.os.Parcelable; | ||
|
||
import com.mapbox.mapboxsdk.geometry.LatLng; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Encapsulates a {@link List} of {@link LatLng} points defining a hole | ||
*/ | ||
public class Hole extends ArrayList<LatLng> implements Parcelable { | ||
|
||
public Hole() { | ||
super(); | ||
} | ||
|
||
/** | ||
* Creates a Hole. | ||
* | ||
* @param holePoints {@link List} list of {@link LatLng} points defining a hole | ||
*/ | ||
public Hole(List<LatLng> holePoints) { | ||
super(holePoints); | ||
} | ||
|
||
protected Hole(Parcel in) { | ||
in.readTypedList(this, LatLng.CREATOR); | ||
} | ||
|
||
@Override | ||
public int describeContents() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public void writeToParcel(Parcel parcel, int i) { | ||
parcel.writeTypedList(this); | ||
} | ||
|
||
public static final Parcelable.Creator<Hole> CREATOR = new Parcelable.Creator<Hole>() { | ||
public Hole createFromParcel(Parcel in) { | ||
return new Hole(in); | ||
} | ||
|
||
public Hole[] newArray(int size) { | ||
return new Hole[size]; | ||
} | ||
}; | ||
} |
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
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