Package io.goobi.viewer.model.misc
Class GeoLocation
java.lang.Object
io.goobi.viewer.model.misc.GeoLocation
Represents a single geographic location with coordinates and an optional display label.
- Author:
- Florian Alpers
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new GeoLocation instance.GeoLocation(Double latitude, Double longitude) Creates a new GeoLocation instance.GeoLocation(org.json.JSONObject json) Creates a new GeoLocation instance. -
Method Summary
Modifier and TypeMethodDescriptionorg.json.JSONObjectgetAsJson.getInfo()Getter for the fieldinfo.Getter for the fieldlatitude.getLink()Getter for the fieldlink.Getter for the fieldlongitude.booleanisEmpty()isEmpty.voidSetter for the fieldinfo.voidsetLatitude(Double latitude) Setter for the fieldlatitude.voidSetter for the fieldlink.voidsetLongitude(Double longitude) Setter for the fieldlongitude.
-
Constructor Details
-
GeoLocation
public GeoLocation()Creates a new GeoLocation instance. -
GeoLocation
Creates a new GeoLocation instance.- Parameters:
latitude- geographic latitude in decimal degrees.longitude- geographic longitude in decimal degrees.
-
GeoLocation
public GeoLocation(org.json.JSONObject json) throws org.json.JSONException Creates a new GeoLocation instance.- Parameters:
json- JSON object containing latitude, longitude, info and link fields.- Throws:
org.json.JSONException- if any.
-
-
Method Details
-
getLatitude
Getter for the fieldlatitude.- Returns:
- the geographic latitude in decimal degrees, or null if not set
-
setLatitude
Setter for the fieldlatitude.- Parameters:
latitude- geographic latitude in decimal degrees.
-
getLongitude
Getter for the fieldlongitude.- Returns:
- the geographic longitude in decimal degrees (WGS84), or null if not set
-
setLongitude
Setter for the fieldlongitude.- Parameters:
longitude- the geographic longitude in decimal degrees (WGS84)
-
getAsJson
public org.json.JSONObject getAsJson()getAsJson.- Returns:
- the geographic coordinates and optional info and link as a JSON object
-
isEmpty
public boolean isEmpty()isEmpty.- Returns:
- true if either latitude or longitude is not set or set to NULL
-
getInfo
Getter for the fieldinfo.- Returns:
- the descriptive text or HTML content shown in the map popup for this location
-
setInfo
Setter for the fieldinfo.- Parameters:
info- the descriptive text or HTML content shown in the map popup for this location
-
getLink
Getter for the fieldlink.- Returns:
- the URL linked from the map popup for this location
-
setLink
Setter for the fieldlink.- Parameters:
link- the URL linked from the map popup for this location
-