Android image map. - displaying an .svg and using it as an image map (touch zones)

pumpkee

I am looking for a way to display an image and have the user tap on different parts of the image to navigate and perform actions.

I was considering using an invisible color map to check which parts have been touched.

But since i also want to highlight the selected areas, i was thinking of using vectors. There is a nice library to render svg files into an image view here, but it doesn't handle touches.
Is there a library out there that does? Or any smarter way of doing this?

(I also checked out this project but it won't swallow .svg files and my vector image is far too complex to insert all the data by hand)

Brian

Interesting problem! I'm not convinced you can't use a combination of the libraries you mentioned.

What I would do is first use SVG-Android to programmatically read in your SVG file. Looking at SVG-Android, it looks like it returns the final product as a PictureDrawable, which is a subclass of Drawable.

Right after SVG-Android finishes processing the SVG graphics, I'd use ImageView.setImageDrawable to load the main ImageView with the PictureDrawable we just generated. Then I'd just use that ImageView as the base for the implementation of "Images with Clickable Areas" you linked in the original question.

Honestly, I think the hardest part will be getting SVG-Android to work correctly (I've played with it a bit, and it's a bit finicky). However, I don't think you'll have much difficulty combining the SVG-generated drawable with the clickable areas. It's a simple change in the source of the base image.

Good luck!

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Android image map. - displaying an .svg and using it as an image map (touch zones)

From Dev

Image map selection in svg

From Dev

Image map selection in svg

From Dev

HTML Image Map Not Displaying Tooltips

From Dev

Projection Problems when Displaying an Image on a Map with Cartopy

From Dev

Background image to SVG choropleth map using D3

From Dev

Svg image not displaying

From Dev

Svg image not displaying

From Dev

SVG Image Map in Wordpress - Hyperlinks do not work

From Dev

HTML SVG map image follow path

From Dev

A star algorithm with image map (android)

From Dev

Using Responsive Image Map with no JQuery

From Dev

Image not loading on Map using MapIcon

From Dev

Using Audio on mouseover on image map

From Dev

Image is not displaying when using Picasso in Android

From Dev

Svg image element not displaying in Safari

From Dev

Touch Image Zooming in android

From Dev

Displaying Large Image in Android

From Dev

android webview not displaying the image

From Dev

Displaying an Image Android

From Dev

displaying image using canvas

From Dev

Depth map - stereo image in Android with OpenCV

From Dev

Colour gradient on a map in R (using image)

From Dev

How to plot data on a map without using Google map (image)?

From Dev

android + universal image loader : show custom marker with image in google map

From Dev

how to display image on circular image on google map in android

From Dev

Image map change image on hover

From Dev

Google map is displaying but not loading map and directions in android

From Dev

Android App with Google map not displaying