Android zoomable view with pin - android

I'm looking for tips or a lib that can help me with this challenge: I need to build a widget that is similar to a Map View. I mean, I have a huge image that will be used as background and a list of coordinates that should be used as pins over the image.
I need to achieve an experience similar to a Map View (pan, zoom and pinch gestures) and treat pin clicks. Once placed over the image, a pin should note move its position considering the background image.
The problem is not really new, but I couldn't solve it yet. I've tried a WebView with some html but the image is rendered really blurry.
Any tip? Any Github project? I've googled a lot and found no answer.

Related

think my Android app needs a pinch zoom and pan LAYOUT

So. Iv'e got a straight forward relative layout which I add multiple ImageViews to.
I don't want the images to obscure each other so as they are added they are translated so they don't.
As more ImageViews are added they need to be translated further and further away from the centre of the layout so as not to overlap other images and so they fall off the edge of the user's screen - no problem so far ...
I need to give the user the ability to pan to see the images that are off screen and also zoom in and out (with gestures not buttons) to see all images or focus in on one.
I think the solution to this problem is to modify the layout to allow pinch and pan but all I can find is how to create views that support pinch and pan.
I need each image to be in a separate ImageView.
Forgive me if this is the wrong way to come at this problem but any help would be much appreciated.
This might help explain:
want to scroll about and zoom around this layout (click to see)

How to show a map which is a big image?

I got a png image which is 5000x5000. This image is some sort of map. I wanted to display the image in an imageview and this gave me an outOfMemoryException(of course). So i tried to set a sampleSize, but this decreased the resolution which makes the map not very usefull.
So basically I want to show this image and be able to zoom and scroll without resolution loses. What would be the best approach?
I am a fan of Dave Morrissey's SubsamplingScaleImageView, which seems to cover what you want. Quoting the project documentation, it is:
A custom image view for Android, designed for photo galleries and displaying huge images (e.g. maps and building plans) without OutOfMemoryErrors. Includes pinch to zoom, panning, rotation and animation support, and allows easy extension so you can add your own overlays and touch event detection.

Zoomable Imageview or Activity

I have an activity that has just a image to show like graphical help. It has a lots of info and needs to be zoomed. I searched alot in diffrent sites and they say imageview is not zoomable. and i found complicated algoritjhms for it. i want to make my programm to zoom like many usual proggrams that zoom like my 2 fingers get further image zooms in and if they get close zooms out and and i want to user be able to move postion if image in image view bye moving his finger on it.if its impossible can i make that as background and do these functions on whole activity? thanks for helping
This SO thread should have everything you need to implement the pinch zoom. Alternatively you could have a look at the PhotoView library; an implementation of ImageView that supports zooming.

create map shopping center (for example) on android

I Never faced with the task to create a map of the shopping center (for example)
I did a project using a single image as a map, image was maximum size, but the image quality is not enough. I understand i need many small images. if user scrolling or zoom or fling map i programmatically change images...
but,I do not know where to begin, please help me your solutions

Merging overlays to display on MKMapView (iOS) or MapView (android)

I'm working on creating a mobile app which overlays images on top of a google map.
I have a large number of image overlays ('GroundOverlay' objects in KML-speak). I'm running into several issues (mainly performance) when the map is scrolled or zoomed
Having tried several options, I think my next approach will be to combine all the image overlays into one image beforehand, and then simply display that image as a single overlay on the map. Problem is, I'm not sure where to start.
Does anyone have any experience in combining overlay images?
I think there are two problems that need to be solved
1) Calculate the larger 'bounding box' that will contain the final image. I have the bounding box for each overlay ('LatLngBox' in KML-speak), and I think the final box can be calculated by simply examining the values of each LatLngBox and generating the final box based on the min/max values. Anyone have any insight as to whether this will work?
2) Merge all the overlay images into a single final image. I have no idea where to start here such here. Generating the actual image isn't the problem, but rather where to place each overlay (ie pixel level) so that the resulting image is accurate.
Any tips/hints would be greatly appreciated.
Thanks
the static overlay images can be combined and drawn. but the moving(regularly updated) overlay images would be an issue if you still want to combine them and post as one. the best option i believe would be to combine the static overlay resources and keep them in one set and other moving images drawn separately.
Managed to figure this out on my own.
Answer to (1): The technique I outlined in my question works perfectly
Answer to (2): You can convert between lat/lng and x/y pixels of an image as described here: Convert Lat/Longs to X/Y Co-ordinates

Categories

Resources