Search in sources :

Example 6 with MarkerSymbol

use of org.oscim.layers.marker.MarkerSymbol in project PocketMaps by junjunguo.

the class MapHandler method createMarkerItem.

private MarkerItem createMarkerItem(GeoPoint p, int resource, float offsetX, float offsetY) {
    // Drawable drawable = activity.getDrawable(resource); // Since API21
    Drawable drawable = ContextCompat.getDrawable(activity, resource);
    Bitmap bitmap = AndroidGraphics.drawableToBitmap(drawable);
    MarkerSymbol markerSymbol = new MarkerSymbol(bitmap, offsetX, offsetY);
    MarkerItem markerItem = new MarkerItem("", "", p);
    markerItem.setMarker(markerSymbol);
    return markerItem;
}
Also used : Bitmap(org.oscim.backend.canvas.Bitmap) MarkerSymbol(org.oscim.layers.marker.MarkerSymbol) MarkerItem(org.oscim.layers.marker.MarkerItem) Drawable(android.graphics.drawable.Drawable)

Aggregations

MarkerSymbol (org.oscim.layers.marker.MarkerSymbol)6 GeoPoint (org.oscim.core.GeoPoint)3 MarkerItem (org.oscim.layers.marker.MarkerItem)3 BuildingLayer (org.oscim.layers.tile.buildings.BuildingLayer)3 VectorTileLayer (org.oscim.layers.tile.vector.VectorTileLayer)3 LabelLayer (org.oscim.layers.tile.vector.labeling.LabelLayer)3 Drawable (android.graphics.drawable.Drawable)2 File (java.io.File)2 Bitmap (org.oscim.backend.canvas.Bitmap)2 MapFileTileSource (org.oscim.tiling.source.mapfile.MapFileTileSource)2 ViewGroup (android.view.ViewGroup)1 SharedTileCache (org.microg.gms.maps.data.SharedTileCache)1 ClearableVectorLayer (org.microg.gms.maps.markup.ClearableVectorLayer)1 AndroidBitmap (org.oscim.android.canvas.AndroidBitmap)1 ItemizedLayer (org.oscim.layers.marker.ItemizedLayer)1 Layers (org.oscim.map.Layers)1 ITileCache (org.oscim.tiling.ITileCache)1 OSciMap4TileSource (org.oscim.tiling.source.oscimap4.OSciMap4TileSource)1