public class Icon extends MapObject
Modifier and Type | Class and Description |
---|---|
protected static class |
Icon.Property |
Constructor and Description |
---|
Icon()
Creates new Icon object.
|
Icon(Map map)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
Point |
getAnchor()
Returns value of anchor property.
|
Point |
getLabelOrigin()
Returns value of labelOrigin property.
|
Point |
getOrigin()
Returns value of origin property.
|
Size |
getScaledSize()
Returns value of scaledSize property.
|
Size |
getSize()
Returns value of size property.
|
java.lang.String |
getUrl()
Returns value of url property.
|
void |
loadFromFile(java.io.File file)
Loads icon image from file.
|
void |
loadFromFile(java.lang.String fileName)
Loads icon image from file.
|
void |
loadFromStream(java.io.InputStream stream,
java.lang.String imageType)
Loads icon image from stream.
|
void |
setAnchor(Point value)
Sets new value for anchor property.
|
void |
setLabelOrigin(Point value)
Sets new value for labelOrigin property.
|
void |
setOrigin(Point value)
Sets new value for origin property.
|
void |
setScaledSize(Size value)
Sets new value for scaledSize property.
|
void |
setSize(Size value)
Sets new value for size property.
|
void |
setUrl(java.lang.String value)
Sets new value for url property.
|
addEventListener, attachObject, cacheProperties, cacheProperties, clone, createJSValue, dispose, fromJSValue, getJSObject, getMap, getProperties, invokeMethod, propertyChanged, removeEventListener, updateProperty
public Icon()
@Deprecated public Icon(Map map)
map
- owner Map objectpublic Point getAnchor()
Represents the position at which to anchor an image in correspondence to the location of the marker on the map. By default, the anchor is located along the center point of the bottom of the image.
setAnchor(com.teamdev.jxmaps.Point)
public void setAnchor(@Nullable Point value)
value
- new property valuegetAnchor()
public Point getLabelOrigin()
Represents the origin of the label relative to the top-left corner of the icon image, if a label is supplied by the marker. By default, the origin is located in the center point of the image.
setLabelOrigin(com.teamdev.jxmaps.Point)
public void setLabelOrigin(Point value)
value
- new property valuegetLabelOrigin()
public Point getOrigin()
Represents the position of the image within a sprite, if any. By default, the origin is located at the top left corner of the image (0, 0).
setOrigin(com.teamdev.jxmaps.Point)
public void setOrigin(@Nullable Point value)
value
- new property valuegetOrigin()
public Size getSize()
Represents the display size of the sprite or image. When using sprites, you must specify the sprite size. If the size is not provided, it will be set when the image loads.
setSize(com.teamdev.jxmaps.Size)
public void setSize(@Nullable Size value)
value
- new property valuegetSize()
@Nullable public Size getScaledSize()
Represents LatLngBounds within which to search. Optional.
setScaledSize(com.teamdev.jxmaps.Size)
public void setScaledSize(@Nullable Size value)
value
- new property valuegetScaledSize()
public java.lang.String getUrl()
Represents the URL of the image or sprite sheet.
setUrl(java.lang.String)
public void setUrl(java.lang.String value)
value
- new property valuegetUrl()
public void loadFromStream(java.io.InputStream stream, java.lang.String imageType)
stream
- source stream.imageType
- type of image. Can be jpeg on png.loadFromFile(java.io.File)
public void loadFromFile(java.io.File file) throws java.io.FileNotFoundException
file
- source file.java.io.FileNotFoundException
loadFromStream(java.io.InputStream, java.lang.String)
public void loadFromFile(java.lang.String fileName) throws java.io.FileNotFoundException
fileName
- name of input file.java.io.FileNotFoundException
loadFromStream(java.io.InputStream, java.lang.String)