public class GLMapDrawable extends GLMapDrawObject
GLMapDrawable is a bridge class that displays single object on map. This can be image,
text or vector object.| Modifier and Type | Class and Description |
|---|---|
static interface |
GLMapDrawable.TransformMode |
| Constructor and Description |
|---|
GLMapDrawable()
Creates new empty image that will be injected to map
|
GLMapDrawable(android.graphics.Bitmap bitmap,
int drawOrder)
Creates image with given draw order and sets bitmap to it
|
GLMapDrawable(int drawOrder)
Creates new empty image with given draw order
|
| Modifier and Type | Method and Description |
|---|---|
float |
getAngle()
Angle of image
|
long |
getDisposeFunction() |
int |
getHeight()
Loaded image height.
|
MapPoint |
getOffset()
Offset of image
|
MapPoint |
getPosition()
Position of image
|
double |
getScale()
Scale of vector object
|
int |
getWidth()
Loaded image width.
|
boolean |
hitTest(GLMapView mapView,
float screenX,
float screenY,
int paddingLeft,
int paddingRight,
int paddingTop,
int paddingBottom)
Tests if point is inside of image
|
boolean |
isRotatesWithMap()
Whether image rotates with the map
|
void |
setAngle(float angle)
Sets angle of image.
|
void |
setBitmap(android.graphics.Bitmap bitmap)
Sets new image to draw
|
void |
setBitmap(android.graphics.Bitmap bitmap,
java.lang.Runnable onReadyToDraw)
Sets new image to draw
|
void |
setOffset(int offsetX,
int offsetY)
Image offset from position.
|
void |
setPosition(MapPoint position)
Sets position of image on map.
|
void |
setRotatesWithMap(boolean rotate)
Sets whether image rotates with the map.
|
void |
setScale(double scale)
Scale of vector object
|
void |
setText(java.lang.String text,
GLMapVectorStyle style)
Sets new text to draw
|
void |
setText(java.lang.String text,
GLMapVectorStyle style,
java.lang.Runnable onReadyToDraw)
Sets new text to draw
|
void |
setTransformMode(int transformMode)
If drawable contains vector object and you will use position and scale to transform vector object, then set this to TransformMode.Custom.
|
void |
setVectorObject(GLMapView mapView,
GLMapVectorObject object,
GLMapVectorCascadeStyle style,
java.lang.Runnable onReadyToDraw)
Sets vector object to draw
|
getDrawOrder, isHidden, setHiddendisposepublic GLMapDrawable(int drawOrder)
drawOrder - Draw order used to sort objects on mappublic GLMapDrawable(android.graphics.Bitmap bitmap,
int drawOrder)
bitmap - bitmap to setdrawOrder - Draw order used to sort objects on mappublic GLMapDrawable()
public long getDisposeFunction()
public void setBitmap(android.graphics.Bitmap bitmap,
java.lang.Runnable onReadyToDraw)
bitmap - new image to drawonReadyToDraw - optional runnable that called when image ready to drawpublic void setBitmap(android.graphics.Bitmap bitmap)
bitmap - new image to drawpublic void setText(java.lang.String text,
GLMapVectorStyle style,
java.lang.Runnable onReadyToDraw)
text - new text to drawstyle - style of the textonReadyToDraw - optional runnable that called when text ready to drawpublic void setText(java.lang.String text,
GLMapVectorStyle style)
text - new text to drawstyle - style of the textpublic void setVectorObject(GLMapView mapView, GLMapVectorObject object, GLMapVectorCascadeStyle style, java.lang.Runnable onReadyToDraw)
mapView - mapView map view for proper style resolvingobject - object to drawstyle - style of objectonReadyToDraw - optional runnable that called when object is ready to drawpublic boolean hitTest(GLMapView mapView, float screenX, float screenY, int paddingLeft, int paddingRight, int paddingTop, int paddingBottom)
mapView - mapView where image is displayedscreenX - x coordinate of point to checkscreenY - y coordinate of point to checkpaddingLeft - left paddingpaddingRight - right paddingpaddingTop - top paddingpaddingBottom - bottom paddingpublic void setPosition(MapPoint position)
image.setPosition(GLMapView.convertGeoToInternal(new MapPoint(-74.0, 40.7))); //New York
position - position coordinates in internal format of GLMapViewMapPointpublic MapPoint getPosition()
public void setScale(double scale)
scale - new scale for vector objectpublic double getScale()
public void setAngle(float angle)
image.setAngle(45);
angle - angle to setpublic float getAngle()
public int getWidth()
public int getHeight()
public void setRotatesWithMap(boolean rotate)
rotate - true to rotate with mappublic boolean isRotatesWithMap()
public void setOffset(int offsetX,
int offsetY)
position
image.setOffset(bmp.getWidth()/2, bmp.getHeight()/2); // image center displayed at position
offsetX - x offset of imageoffsetY - y offset of imagesetPosition(MapPoint)public void setTransformMode(int transformMode)
transformMode - mode of transforming position and scalepublic MapPoint getOffset()
Copyright © 2018 GetYourMap. All Rights Reserved.