Class SquaremapMarker
java.lang.Object
io.github.emcw.squaremap.entities.SquaremapMarker
Represents a map marker from the Squaremap API.
 When constructed, its values are set by parsing info from its respective object (the passed argument) in the response data.
 
It is responsible for extracting relevent info from the
You could look at this class as being somewhere between a raw JsonObject marker and a fully fledged
It is responsible for extracting relevent info from the
tooltip and popup HTML strings
 and then storing the semi-raw data which should be fully parsed later.
 You could look at this class as being somewhere between a raw JsonObject marker and a fully fledged
SquaremapTown or SquaremapNation.- See Also:
 
- 
Field Summary
FieldsModifier and TypeFieldDescriptionfinal intfinal Stringfinal kotlin.Pair<int[], int[]> final Stringfinal Stringfinal Stringfinal Stringfinal booleanfinal SquaremapLocationfinal Stringfinal Stringfinal Stringfinal com.google.gson.JsonArrayfinal booleanfinal booleanfinal Stringfinal Stringfinal String - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic kotlin.Pair<int[], int[]> getBounds(com.google.gson.JsonArray points) Parsespointsinto two seperate arrays, which we call bounds for the sake of simplicity.
For example:
[{ "x": 500, z": -200 }, { "x": 7000, "z: "80" }]
Would become:
Pairinvalid input: '<'[500, 7000], [-200, 80]>getNamesFromString(String names) static com.google.gson.JsonObjectparsePopup(String popupStr) static com.google.gson.JsonObjectparseTooltip(String tooltipStr)  
- 
Field Details
- 
townName
 - 
nationName
 - 
color
 - 
fillColor
 - 
residents
 - 
councillors
 - 
townWiki
 - 
nationWiki
 - 
mayor
 - 
founded
 - 
board
 - 
isCapital
public final boolean isCapital - 
PVP
public final boolean PVP - 
PUBLIC
public final boolean PUBLIC - 
points
public final com.google.gson.JsonArray points - 
bounds
public final kotlin.Pair<int[],int[]> bounds - 
location
 - 
area
public final int area 
 - 
 - 
Constructor Details
- 
SquaremapMarker
public SquaremapMarker(com.google.gson.JsonObject rawMarkerObj)  
 - 
 - 
Method Details
- 
getBounds
public static kotlin.Pair<int[],int[]> getBounds(com.google.gson.JsonArray points) Parsespointsinto two seperate arrays, which we call bounds for the sake of simplicity.
For example:
[{ "x": 500, z": -200 }, { "x": 7000, "z: "80" }]
Would become:
Pairinvalid input: '<'[500, 7000], [-200, 80]>- Returns:
 - New pair of int arrays. First = all points on the X axis. Second = all points on the Z axis.
 
 - 
getNamesFromString
 - 
getResidentNames
 - 
getCouncillorNames
 - 
parseTooltip
 - 
parsePopup
 
 -