I am developing an application which makes use of google map. I have some overlays added to show location of certain places. These overlay items can tap to get more information. I followed the link How to show a balloon above a marker in a MapActivity? Isn't there a widget? to achieve. Besides, I need to show some animation around the overlay item to show that it is being selected.
I have one idea which is to draw some circles(just stroke, without fill) simultaneously one after another. Start from small circle with thicker stroke to big circle with thinner stroke. When the second circle is drawn, the first circle should disappear. It would be like circle gradually growing (ripple effect) . Of course, it would disappear and start the process over again.
I am having trouble with drawing circles on the mapview. Is it just another overlay or something else? I would be grateful if anyone could show me similar thread or recommendation. Any suggestion are welcome too.
Related
I am experimenting with Views in Android and am trying to create a custom 'widget'. What I want to do is create a portion of a circle with an indicator at 12'o clock. I'd then like to to swipe over the circle and when I do, I'd like to see the indicator move to left or right corresponding to a swipe to the left or the right.
I have looked up a number of sources however I am unsure of how to draw an 'indicator' within the arc. In addtion, what needs to be done to animate the arc ? Can this be achieved without OpenGL ?
I am aware of the circlular progress bar and I believe the problem is quite similar, however I didn't have to add a marker inside the circle.
Here is an image of the screen shot of the View I would like to recreate:
This approach would work,Creating a View with rounded corners and position it to bottom to make it seem like arc
I'm currently trying to create a circle (via canvas drawing, opengl or drawable) and define 4-5 buttons inside of it. My first thought was to create some drawables (quarters of circles) and overlay them onto the main circle, but then I'll have the touchable zone too large - e.g. in the middle of the main circle.
Is there anyone who tried this and found a decent solution to it?
You could just override onTouch() in your custom View that draws the circle (and other button graphics), and do a bit of simple maths when you get the finger down event to determine whether the user has touched within the circle, and what particular defined zone within the circle.
I'm developing an application in which i have to show a map with the aim on it. just like it is on the picture. When a user drags map with a finger, map is moving and the aim isn't. I can make a translucent layout over the map, but can't understand how to draw a transparent circle. Please give me some ideas. Thanks!
I suppose it depends how you're drawing the translucent overlay, but if you were using Canvas methods, you can try with the clip methods to intersect with a path. http://developer.android.com/reference/android/graphics/Canvas.html#clipPath(android.graphics.Path)
I am new to android. I am working on a project which uses map. I want to draw an overlay item on a specific geopoint which contains a rectangle, some location info and a button which makes the overlay invisible when clicked. I can draw rectangle and text using drawRect() and drawText() in the draw method of overlay. The problem is that how to draw a button as a part of overlay which is clickable or something like that. Can anybody suggest something...???
Read the following links and download the code in the links
https://github.com/jgilfelt/android-mapviewballoons
https://github.com/jgilfelt/android-mapviewballoons#readme.
it really working nice to display button on the map.
I have faced some problems with the Android MapView API. I get OverlayItems from a database which I want to display in a MapView. If I'm displaying 100 Icons, I have no issues, but if it gets more - like 500 Items in one City - it first looks really bad, while second it slows down a lot. Unfortunately my goal is to display 10000 of them. I think one solution can be to register a listener to ZoomLevels to make them appear/dissapear, but I couldn't find that functionality. Second, I couldn't find a function to scale my Overlays with the Zoom of the Map.
Any Ideas are very welcome
There is a very strange behavior in ItemizedOverlay draw method. When you say: Draw line from (x,y) to (x1,y1) the draw method is called about 20-30-40 times - i don't know why. It is acceptable when you draw one line, but when you draw a thousands of lines,icons and so on...it is very very bad! To solve this problem you should create a cached overlay. This is overlay that catches the first draw, creates the object and then prevents the future draws that do the same draw.
A cluster is a dozen of icons behind one icon. For example if you have 1000 markers on the map, in a specific minimal zoom level you can not see each marker separately - it becomes a mess of icons and colors and so on. And instead of 100 markers that are very very close one by one you place a cluster marker. And on zoom in remove this cluster and create another clusters...do this until the markers became far enough away and you can seen them divided.
Check this: Cluster markers
Take the following approaches:
Create a cached overlay to prevent multiple drawing of same clusters;
Draw in thread;
Cluster your markers depending on zoom level and marker proximity.
Each time you draw in the overlay, check for sure is the current marker inside of the visible part of the screen. If it is not, do no draw it!
I had a similar problem with the icon size and zoom level in my application. What I ended up doing was having 2 sets of overlays containing the markers, one with a "zoomed in" icon and one with a "zoomed out" icon. Then just changed the overlay at a certain zoom level (using a zoom poller - On zoom event for google maps on android)