public class ImageryInfo extends TileSourceInfo implements Comparable<ImageryInfo>, Attributed
Modifier and Type | Class and Description |
---|---|
static class |
ImageryInfo.ImageryBounds
Multi-polygon bounds for imagery backgrounds.
|
static class |
ImageryInfo.ImageryPreferenceEntry
Auxiliary class to save an
ImageryInfo object in the preferences. |
static class |
ImageryInfo.ImageryType
Type of imagery entry.
|
Modifier and Type | Field and Description |
---|---|
private String |
attributionImage
Image of a graphical attribution displayed when using the imagery
|
private String |
attributionImageURL
Link behind the graphical attribution displayed when using the imagery
|
private String |
attributionLinkURL
Link behing the text attribution displayed when using the imagery
|
private String |
attributionText
Text of a text attribution displayed when using the imagery
|
private ImageryInfo.ImageryBounds |
bounds
display bounds of imagery, displayed in prefs and used for automatic imagery selection
|
private String |
cookies
The data part of HTTP cookies header in case the service requires cookies to work
|
private String |
countryCode
country code of the imagery (for country specific imagery)
|
private boolean |
defaultEntry
whether this is a entry activated by default or not
|
private int |
defaultMaxZoom
maximum zoom level for TMS imagery
|
private int |
defaultMinZoom
minimum zoom level for TMS imagery
|
private String |
description
description of the imagery entry, should contain notes what type of data it is
|
private String |
eulaAcceptanceRequired
Whether this service requires a explicit EULA acceptance before it can be activated
|
private String |
icon
icon used in menu
|
private ImageryInfo.ImageryType |
imageryType
type of the imagery servics - WMS, TMS, ...
|
private boolean |
isEpsg4326To3857Supported |
private boolean |
isGeoreferenceValid |
private String |
langDescription
language of the description entry
|
private String |
langName
(original) language of the translated name entry
|
private String |
origName
original name of the imagery entry in case of translation call, for multiple languages English when possible
|
private double |
pixelPerDegree |
private List<String> |
serverProjections
projections supported by WMS servers
|
private String |
termsOfUseText
Text with usage terms displayed when using the imagery
|
private String |
termsOfUseURL
Link behind the text with usage terms displayed when using the imagery
|
id, maxZoom, metadataHeaders, minZoom, name, noTileHeaders, url
Constructor and Description |
---|
ImageryInfo()
Constructs a new WMS
ImageryInfo . |
ImageryInfo(ImageryInfo.ImageryPreferenceEntry e)
Constructs a new
ImageryInfo from an imagery preference entry. |
ImageryInfo(ImageryInfo i)
Constructs a new
ImageryInfo from an existing one. |
ImageryInfo(String name)
Constructs a new WMS
ImageryInfo with a given name. |
ImageryInfo(String name,
String url)
Constructs a new WMS
ImageryInfo with given name and extended URL. |
ImageryInfo(String name,
String url,
String eulaAcceptanceRequired)
Constructs a new WMS
ImageryInfo with given name, extended and EULA URLs. |
ImageryInfo(String name,
String url,
String type,
String eulaAcceptanceRequired,
String cookies)
Constructs a new
ImageryInfo with given name, url, extended and EULA URLs. |
ImageryInfo(String name,
String url,
String type,
String eulaAcceptanceRequired,
String cookies,
String id) |
Modifier and Type | Method and Description |
---|---|
void |
clearId() |
int |
compareTo(ImageryInfo in) |
void |
copyAttribution(ImageryInfo i)
Copies attribution from another
ImageryInfo . |
boolean |
equals(Object o) |
boolean |
equalsBaseValues(ImageryInfo in) |
boolean |
equalsPref(ImageryInfo other)
Check if this object equals another ImageryInfo with respect to the properties
that get written to the preference file.
|
Image |
getAttributionImage() |
String |
getAttributionImageURL() |
String |
getAttributionLinkURL() |
String |
getAttributionText(int zoom,
ICoordinate topLeft,
ICoordinate botRight) |
ImageryInfo.ImageryBounds |
getBounds()
Returns the imagery polygonial bounds.
|
String |
getCookies()
Return the data part of HTTP cookies header in case the service requires cookies to work
|
String |
getCountryCode()
Returns the ISO 3166-1-alpha-2 country code.
|
String |
getDescription()
Returns the description text when existing.
|
String |
getEulaAcceptanceRequired()
Returns the EULA acceptance URL, if any.
|
String |
getExtendedUrl()
Returns the extended URL, containing in addition of service URL, its type and min/max zoom info.
|
String |
getIcon()
Returns the entry icon.
|
ImageryInfo.ImageryType |
getImageryType()
Returns the imagery type.
|
int |
getMaxZoom()
Returns the maximum zoom level.
|
String |
getMenuName() |
int |
getMinZoom()
Returns the minimum zoom level.
|
Map<String,String> |
getNoTileHeaders()
Request header information for empty tiles for servers delivering such tile types
|
String |
getOriginalName()
Returns the entry name.
|
double |
getPixelPerDegree() |
List<String> |
getServerProjections()
Get the projections supported by the server.
|
String |
getTermsOfUseText() |
String |
getTermsOfUseURL() |
String |
getToolbarName() |
String |
getToolTipText()
Returns a tool tip text for display.
|
boolean |
hasAttribution()
Determines if this entry requires attribution.
|
int |
hashCode() |
boolean |
isBlacklisted()
Returns true if this layer's URL is matched by one of the regular
expressions kept by the current OsmApi instance.
|
boolean |
isDefaultEntry()
Determines if this entry is enabled by default.
|
boolean |
isEpsg4326To3857Supported() |
boolean |
isGeoreferenceValid() |
boolean |
requiresAttribution() |
void |
setAttribution(AbstractTileSource s)
Applies the attribution from this object to a tile source.
|
void |
setAttributionImage(String text) |
void |
setAttributionImageURL(String text) |
void |
setAttributionLinkURL(String text) |
void |
setAttributionText(String text) |
void |
setBounds(ImageryInfo.ImageryBounds b)
Sets the imagery polygonial bounds.
|
void |
setCountryCode(String countryCode)
Sets the ISO 3166-1-alpha-2 country code.
|
void |
setDefaultEntry(boolean defaultEntry)
Sets the default state of this entry.
|
void |
setDefaultMaxZoom(int defaultMaxZoom)
Sets the maximum zoom level.
|
void |
setDefaultMinZoom(int defaultMinZoom)
Sets the minimum zoom level.
|
void |
setDescription(String language,
String description)
Sets the description text when existing.
|
void |
setEpsg4326To3857Supported(boolean isEpsg4326To3857Supported) |
void |
setEulaAcceptanceRequired(String eulaAcceptanceRequired)
Sets the EULA acceptance URL.
|
void |
setExtendedUrl(String url)
Sets the extended URL of this entry.
|
void |
setGeoreferenceValid(boolean isGeoreferenceValid) |
void |
setIcon(String icon)
Sets the entry icon.
|
void |
setImageryType(ImageryInfo.ImageryType imageryType)
Sets the imagery type.
|
void |
setMetadataHeaders(Map<String,String> metadataHeaders)
Returns the map of <header name, metadata key> indicating, which HTTP headers should
be moved to metadata
|
void |
setName(String language,
String name)
Sets the entry name and handle translation.
|
void |
setNoTileHeaders(Map<String,String> noTileHeaders)
Sets the map of <header name, header value> that if any of this header
will be returned, then this tile will be treated as "no tile at this zoom level"
|
void |
setPixelPerDegree(double ppd) |
void |
setServerProjections(Collection<String> serverProjections) |
void |
setTermsOfUseText(String text) |
void |
setTermsOfUseURL(String text) |
String |
toString() |
getId, getMetadataHeaders, getName, getTileSize, getUrl, setId, setName, setTileSize, setUrl
private String origName
private boolean defaultEntry
private String cookies
private String eulaAcceptanceRequired
private ImageryInfo.ImageryType imageryType
private double pixelPerDegree
private int defaultMaxZoom
private int defaultMinZoom
private ImageryInfo.ImageryBounds bounds
private List<String> serverProjections
private String description
private String langDescription
private String attributionText
private String attributionLinkURL
private String attributionImage
private String attributionImageURL
private String termsOfUseText
private String termsOfUseURL
private String countryCode
private boolean isGeoreferenceValid
private boolean isEpsg4326To3857Supported
public ImageryInfo()
ImageryInfo
.public ImageryInfo(String name)
ImageryInfo
with a given name.name
- The entry namepublic ImageryInfo(String name, String url)
ImageryInfo
with given name and extended URL.name
- The entry nameurl
- The entry extended URLpublic ImageryInfo(String name, String url, String eulaAcceptanceRequired)
ImageryInfo
with given name, extended and EULA URLs.name
- The entry nameurl
- The entry URLeulaAcceptanceRequired
- The EULA URLpublic ImageryInfo(String name, String url, String type, String eulaAcceptanceRequired, String cookies)
ImageryInfo
with given name, url, extended and EULA URLs.name
- The entry nameurl
- The entry URLtype
- The entry imagery type. If null, WMS will be used as defaulteulaAcceptanceRequired
- The EULA URLcookies
- The data part of HTTP cookies header in case the service requires cookies to workIllegalArgumentException
- if type refers to an unknown imagery typepublic ImageryInfo(String name, String url, String type, String eulaAcceptanceRequired, String cookies, String id)
public ImageryInfo(ImageryInfo.ImageryPreferenceEntry e)
ImageryInfo
from an imagery preference entry.e
- The imagery preference entrypublic ImageryInfo(ImageryInfo i)
ImageryInfo
from an existing one.i
- The other imagery infopublic boolean equalsPref(ImageryInfo other)
pixelPerDegree
is ignored.other
- the ImageryInfo object to compare topublic int compareTo(ImageryInfo in)
compareTo
in interface Comparable<ImageryInfo>
public boolean equalsBaseValues(ImageryInfo in)
public void setPixelPerDegree(double ppd)
public void setDefaultMaxZoom(int defaultMaxZoom)
defaultMaxZoom
- The maximum zoom levelpublic void setDefaultMinZoom(int defaultMinZoom)
defaultMinZoom
- The minimum zoom levelpublic void setBounds(ImageryInfo.ImageryBounds b)
b
- The imagery bounds (non-rectangular)public ImageryInfo.ImageryBounds getBounds()
public boolean requiresAttribution()
requiresAttribution
in interface Attributed
public String getAttributionText(int zoom, ICoordinate topLeft, ICoordinate botRight)
getAttributionText
in interface Attributed
zoom
- The optional zoom level for the view.topLeft
- The top left of the bounding box for attribution.botRight
- The bottom right of the bounding box for attribution.public String getAttributionLinkURL()
getAttributionLinkURL
in interface Attributed
public Image getAttributionImage()
getAttributionImage
in interface Attributed
public String getAttributionImageURL()
getAttributionImageURL
in interface Attributed
public String getTermsOfUseText()
getTermsOfUseText
in interface Attributed
public String getTermsOfUseURL()
getTermsOfUseURL
in interface Attributed
public void setAttributionText(String text)
public void setAttributionImageURL(String text)
public void setAttributionImage(String text)
public void setAttributionLinkURL(String text)
public void setTermsOfUseText(String text)
public void setTermsOfUseURL(String text)
public void setExtendedUrl(String url)
url
- Entry extended URL containing in addition of service URL, its type and min/max zoom infopublic String getOriginalName()
public void setName(String language, String name)
language
- The used languagename
- The entry namepublic void clearId()
public boolean isDefaultEntry()
true
if this entry is enabled by default, false
otherwisepublic void setDefaultEntry(boolean defaultEntry)
defaultEntry
- true
if this entry has to be enabled by default, false
otherwisepublic String getCookies()
getCookies
in class TileSourceInfo
public double getPixelPerDegree()
public int getMaxZoom()
getMaxZoom
in class TileSourceInfo
public int getMinZoom()
getMinZoom
in class TileSourceInfo
public String getDescription()
public void setDescription(String language, String description)
language
- The used languagedescription
- the imagery description textpublic String getToolTipText()
public String getEulaAcceptanceRequired()
null
public void setEulaAcceptanceRequired(String eulaAcceptanceRequired)
eulaAcceptanceRequired
- The URL to an EULA text that has to be accepted before usepublic String getCountryCode()
public void setCountryCode(String countryCode)
countryCode
- The country code (2 letters)public List<String> getServerProjections()
public void setServerProjections(Collection<String> serverProjections)
public String getExtendedUrl()
public String getToolbarName()
public String getMenuName()
public boolean hasAttribution()
true
if some attribution text has to be displayed, false
otherwisepublic void copyAttribution(ImageryInfo i)
ImageryInfo
.i
- The other imagery info to get attribution frompublic void setAttribution(AbstractTileSource s)
s
- The tile sourcepublic ImageryInfo.ImageryType getImageryType()
public void setImageryType(ImageryInfo.ImageryType imageryType)
imageryType
- The imagery typepublic boolean isBlacklisted()
true
is this entry is blacklisted, false
otherwisepublic void setNoTileHeaders(Map<String,String> noTileHeaders)
noTileHeaders
- Map of <header name, header value> which will be treated as "no tile at this zoom level"public Map<String,String> getNoTileHeaders()
TileSourceInfo
getNoTileHeaders
in class TileSourceInfo
public void setMetadataHeaders(Map<String,String> metadataHeaders)
metadataHeaders
- map of <header name, metadata key> indicating, which HTTP headers should be moved to metadatapublic boolean isEpsg4326To3857Supported()
public void setEpsg4326To3857Supported(boolean isEpsg4326To3857Supported)
public boolean isGeoreferenceValid()
public void setGeoreferenceValid(boolean isGeoreferenceValid)