Package globus.glmap
Class GLMapDrawable
java.lang.Object
globus.glmap.GLNativeObject
globus.glmap.GLMapDrawObject
globus.glmap.GLMapDrawable
- Direct Known Subclasses:
- GLMapBalloon,- GLMapImage,- GLMapLabel,- GLMapVectorLayer
GLMapDrawable is a bridge class that displays single object on map. This can be
 image, text or vector object.- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic @interfaceDetermines how to use scale and offset of drawable
- 
Method SummaryModifier and TypeMethodDescriptionfloatgetAngle()Angle of imageintLoaded image height.Offset of imagePosition of imagedoublegetScale()Scale of vector objectintgetWidth()Loaded image width.booleanhitTest(GLMapViewRenderer mapView, float screenX, float screenY, int paddingLeft, int paddingRight, int paddingTop, int paddingBottom) Tests if point is inside of imagebooleanWhether image rotates with the mapvoidsetAngle(float angle) Sets angle of image.voidsetOffset(int offsetX, int offsetY) Image offset from position.voidsetPosition(MapPoint position) Sets position of image on map.voidsetRotatesWithMap(boolean rotate) Sets whether image rotates with the map.voidsetScale(double scale) Scale of vector objectvoidsetTransformMode(int transformMode) If drawable contains vector object and you will use position and scale to transform vector object, then set this to TransformMode.Custom.Methods inherited from class globus.glmap.GLMapDrawObjectgetDrawOrder, isHidden, setHiddenMethods inherited from class globus.glmap.GLNativeObjectdispose
- 
Method Details- 
hitTestpublic boolean hitTest(@NonNull GLMapViewRenderer mapView, float screenX, float screenY, int paddingLeft, int paddingRight, int paddingTop, int paddingBottom) Tests if point is inside of image- Parameters:
- mapView- mapView where image is displayed
- screenX- x coordinate of point to check
- screenY- y coordinate of point to check
- paddingLeft- left padding
- paddingRight- right padding
- paddingTop- top padding
- paddingBottom- bottom padding
- Returns:
- `true` if point is inside image
 
- 
setPositionSets position of image on map.image.setPosition(GLMapView.convertGeoToInternal(new MapPoint(-74.0, 40.7))); //New York- Parameters:
- position- position coordinates in internal format of GLMapView
- See Also:
 
- 
getPositionPosition of image- Returns:
- position of image in internal coordinates of GLMapView
 
- 
setScalepublic void setScale(double scale) Scale of vector object- Parameters:
- scale- new scale for vector object
 
- 
getScalepublic double getScale()Scale of vector object- Returns:
- scale of vector object
 
- 
setAnglepublic void setAngle(float angle) Sets angle of image.image.setAngle(45);- Parameters:
- angle- angle to set
 
- 
getAnglepublic float getAngle()Angle of image- Returns:
- angle of image in degrees.
 
- 
getWidthpublic int getWidth()Loaded image width.- Returns:
- width of image in pixels.
 
- 
getHeightpublic int getHeight()Loaded image height.- Returns:
- height of image in pixels.
 
- 
setRotatesWithMappublic void setRotatesWithMap(boolean rotate) Sets whether image rotates with the map.- Parameters:
- rotate-- trueto rotate with map
 
- 
isRotatesWithMappublic boolean isRotatesWithMap()Whether image rotates with the map- Returns:
- true if image rotates with the map
 
- 
setOffsetpublic void setOffset(int offsetX, int offsetY) Image offset from position. When offset is (0,0), bottom left corner of image is displayed atpositionimage.setOffset(bmp.getWidth()/2, bmp.getHeight()/2); // image center displayed at position- Parameters:
- offsetX- x offset of image
- offsetY- y offset of image
- See Also:
 
- 
setTransformModepublic 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.- Parameters:
- transformMode- mode of transforming position and scale
 
- 
getOffsetOffset of image- Returns:
- offset of image in pixels
 
 
-