I want to display a custom image below a marker in my Android App. I see no available documentation so that I can execute this.
Have a look at what I want to achieve here. It is like an indicator and should be anchored to the markers and the distance between markers and image should not vary.
Related
I Want to Implement clustering google map in android like the picture .I want to Know three things can anyone help me?
1- how can have different size of cluster belong to number of cluster items?
2-how can have those colors around the circle that depends on some parameters
3-how can we show the number that shows on circle except number of marker in it? for example for another parameter.
I am trying to make an indoor map of a hospital , when i click on certain buildings it would open their respective indoor maps and when i select a certain area of their respective floor it would show me further details.How can I achieve this?
Any suggestions would be appreciated.
P.S I have tried using image view but i can't get the image to scroll freely like a real map or a webview (pinch zoom in/zoom out ,rotation etc).
As you wanted your "floor" to have the behavior of a map you should have look for custom map implementations.
Then you may have found that you can use your own Tile Overlay using a Custom Map Tile Provider as described in Using custom map tiles with Google Map API V2 for Android?
Or if you don't want to use Google, you can look at Open Street Map Android SDK
Ether way you are still responsible for the graphical assets of tile layers. As well as any UI/UX leading to the custom map view.
Alternatively there are third-party libraries for 'deep zoom' of an image which may provide the expected touch behavior like: https://github.com/davemorrissey/subsampling-scale-image-view
You can have rooms as scolling views, with a background view image and buttons where you want to click. Clicking the buttons opens a popup with an image. You can also place transparent buttons on the buildings to have a natural feeling of click to open.
From your question it seems that you don't want to use web view, but you can code a regular html page/web app and use a web view to display it. That way, you only have a screen with a web view to deal with.
Then the possibilities are endless and fun and shifts in the web domain!
I'm struggling to find a solution to the following problem in Android:
there should be custom views on the map which should animate/expand/etc just like regular views. For instance I need a current user location indicator which "pulsates" on the map, or I need some kind of marker clustering with the following behavior: when I tap on the cluster all the pois from this cluster are animated out evenly spread around the cluster so you can click them individually.
I've seen solutions involving periodically drawing into bitmap canvas and then updating the marker's bitmap, but it doesn't help when you want to click on the expanded items in the bitmap, also animating a marker with updating it's bitmap would look horrible and clunky.
On iOS for example there is a class MKAnnotationView which you can override and draw however you want, why doesn't android have such a simple feature? How can this be achieved in Android? Any help is appreciated.
Building custom overlay specifically circle with radius(colored) in Android MapBox GL. It allows to change radius dynamically using seekbar.
I'm trying to build some custom markers and I used SimpleCircleView but Im having problem trying to display it in MapBox GL android, and it created lots of bugs.
The map touch event is unresponsive once my CircleOverlay is displayed in map
The marker doesnt stay in its coordinates once i zoom-in , zoom-out.
Updating markers doesnt work, So I have to remove then add again the marker.
The color does not match the color that I set in marker.
I'll limit my posting on code, because this repo is mine and to keep the problem understandable.
In building custom overlay I have to make these classes:
CircleMarkerView.java - The Custom Marker View
[CircleMarkerViewOptions.java] (https://github.com/spurdow/SimpleCircleView/blob/master/app/src/main/java/com/spurdow/circleviewtest/CircleMarkerViewOptions.java) - This is to be used with CircleMarkerView
SimpleCircleView.java - This is my custom view for dynamic circle changing its radius etc.
MainActivityMapBox - This is where to put it all
This is an example of the code in the repo.
Does anybody have any idea how to do this simply?
Or
Is there another way of building an overlay dynamically?
Or
Is it possible to create a circle bitmap dynamically and convert it to icon when seekbar's progress is changing?
1. The map touch event is unresponsive once my CircleOverlay is displayed in map
This is an issue we plan to address by next release, you can follow progress on this here.
2. The marker doesnt stay in its coordinates once i zoom-in , zoom-out.
The could be because you aren't anchoring the marker icon correctly using .setAnchor() or your icon has padding around it. For a circle, you'll want to anchor centered (using 0.5f). A bug was introduced right before the previous stable release that causes anchoring not to work correctly. If this is an issue, use the 4.2.0-SNAPSHOT.
3. Updating markers doesnt work, So I have to remove then add again the marker.
Could you elaborate on this issue? You might be using
Marker marker = mapboxMap.addMarker(new MarkerViewOptions()...
When you should be using:
MarkerView marker = mapboxMap.addMarker(new MarkerViewOptions()...
Which will give you more options to update markers.
4. The color does not match the color that I set in marker.
Could you clarify what you mean by this?
It sounds like you are wanting to do what this example does in the testapp? I would follow along with the code found there.
I am trying to create an indoor map like the below image.This is scrollable/moving in the whole screen.I am not getting what is a right approach to create it .Is this a Google Indoor Map ?
How can i create buttons over an image like this map ?
Please Suggest.
I would recommend using a standard image file / breaking your image into tiles, then making a custom View which loads your map image and captures all the touch events for scrolling and click detection.
If you want clickable overlays you could take two approaches:
Include the buttons in the source image and look for hotspots in the image when it is clicked.
Create a list of co-ordinates within your image to overlay a button graphic, when a click is detected you can compare the position of the click with this list (and a small margin for error).
Personally I prefer the second method and have used it successfully in several projects requiring maps with clickable points of interest.
I got the solution by creating an Imagemap using html and embedded that html in a WebView.