Skip to content Skip to sidebar Skip to footer

How To Add A Marker/pin On An Imageview Android?

I would like to ask on how to implement or add a marker on an imageView. I rendered an SVG using svglib and used a customImageView so that I can zoom and pan around the image. here

Solution 1:

This is a nice library for displaying images, which supports zooming/panning and adding pins over the image https://github.com/davemorrissey/subsampling-scale-image-view

Solution 2:

 drawable.draw(canvas);

// ---add the marker---Bitmapmarker= BitmapFactory.decodeResource(getResources(),
        R.drawable.search_marker_icon);
canvas.drawBitmap(marker, 40, 40, null);
PaintmPaint=newPaint();
mPaint.setColor(Color.RED);
canvas.drawCircle(60, 60, 5, mPaint);


        canvas.restore();
    }

    if (drawLock.availablePermits() <= 0) {
        drawLock.release();
    }
}
 super.onDraw(canvas);
}   

You need to do this before canvas.restore..... :D got this solution last year...... thnx for the help guys.... my app is almost done :)

Solution 3:

An implementation of an HTML map like element in an Android View:

  • Supports images as drawable or bitmap in layout
  • Allows for a list of area tags in xml
  • Enables use of cut and paste HTML area tags to a resource xml (ie, the ability to take an HTML map - and image and use it with minimal editing)
  • Supports panning if the image is larger than the device screen
  • Supports pinch-zoom
  • Supports callbacks when an area is tapped.
  • Supports showing annotations as bubble text and provide callback if the bubble is tapped

try this link you will find your solution https://github.com/catchthecows/AndroidImageMap

Post a Comment for "How To Add A Marker/pin On An Imageview Android?"