I want to plot heat map on android phone based on the signal strength in a area. i am able to get google map using android map api v2 . but i am not getting any idea how to plot heatmap on it . I have gone through
using Android Google Maps API to display a Heat Map layer but the link to mapex here didn't help much . Please help
This is just a thought, but have you thought of using Circles built in V2 maps.. This may sound weird but it may suit your needs...
I would assume each point has a specific radius that you could set and then you could use a color with some transparency that when close to other points would overlap each other making the color darker in areas of higher point concentration and lighter in areas of less concentration. Of course this would only work if you were looking to do this with one color and different shades of that color. For example:
// Instantiates a new CircleOptions object and defines the center and radius
CircleOptions circleOptions = new CircleOptions()
.center(new LatLng(37.4, -122.1))
.radius(10)); // In meters
.fillColor(0x1AFF0000)//90% transparent red
.strokeColor(Color.TRANSPARENT)//dont show the border to the circle
// Get back the mutable Circle
Circle circle = myMap.addCircle(circleOptions);
And if you were to do this and then add it again at the same point but with a radius of 20, you would get an output like the attached image which would allow you to fade from a specific point as it gets further away. It would be as simple as throwing all your points in a for loop and adding the circles to the map in the loop. This may not be what your looking for but may help someone!
Related
I have a Google map were I draw rectangles.
I have a draggable marker that makes the rectangle change is size as you move your finger.
I do polygon.remove and then create a new polygon with new points (one of the corners is the marker position and I calculate the others)
The resize is working, but the problem is that graphics are slow, you can see the polygon dissapear and reappear.
Is it because of a hardware limitation or there's another better approach?
From the documentation of Google Maps Android API, it is stated in the Polygon part here that to alter the shape of the polygon after it has been added, you can call Polygon.setPoints() and provide a new list of points for the outline of the polygon.
So you must update the shape by calling Polygon.setPoints() rather than adding/removing it.
For more information, just check the link above.
I am able to get current direction when i walk. What i try to make is drawing an arc or quarter circle to my direction and getting edge points of my circle.
Actually i am trying to get 3 points. I am able to get my current location. The other 2 locations are the edge points of my arc in my direction. It is not a must drawing arc or circle to my direction. Maybe drawing polygon is acceptable for me.
Can you help me to find out a solution on this ?
Thanks,
Maybe you can start reading the documentation of Shapes in the Google Maps Android API, it explains here some simple ways to add shapes to your maps in order to customize them for your application.
Polyline is a series of connected line segments that can form any shape you want and can be used to mark paths and routes on the map.
The Polyline class defines a set of connected line segments on the map. It also consists of a set of LatLng locations, and creates a series of line segments that connect those locations in an ordered sequence. Just check the this link on how to create Polylines
Polygon is an object that are similar to Polyline objects in that they consist of a series of coordinates in an ordered sequence. However, instead of being open-ended, polygons are designed to define regions within a closed loop with the interior filled in. You can add a Polygon to the map in the same way as you add a Polyline.
Circles is a geographically accurate projection of a circle on the Earth's surface drawn on the map.
The following code snippet adds a circle to the map by constructing a CircleOptions object and calling GoogleMap.addCircle(CircleOptions):
// Instantiates a new CircleOptions object and defines the center and radius
CircleOptions circleOptions = new CircleOptions()
.center(new LatLng(37.4, -122.1))
.radius(1000)); // In meters
// Get back the mutable Circle
Circle circle = myMap.addCircle(circleOptions);
For more sample code check the documentation and this link.
I want to develop below picture in android, which is already implemented in iOS.
I know how to add circle on google map. but as shown in picture the color should be filled on map not on the circle, circle must be fully transparent.
i have referred many links but all of that put the simple overlay on map, so when user zoom in or zoom out the map; circle remains the same.
i have implemented simple circle around current location.
googleMap.addCircle(new CircleOptions()
.center(new LatLng(MyApplication.latitude, MyApplication.longitude))
.radius(800)
.fillColor(0x70ffffff))
.setStrokeWidth(0);
i want above functionality with inverse color. circle should be only around current location and the size should vary with zoom in and zoom out of map.
Thanks.
I have been working on google maps v2 drawing a circle which can be resized on dragging circumference of the circle.
Cirlce circle = mMap.addCircle(new CircleOptions()
.center(center)
.radius(radius)
.strokeWidth(2)
.strokeColor(Color.BLUE)
.fillColor(Color.parseColor("#500084d3")));
Now problem comes for large value of radius the circle becomes and oval.
I have referred these link and also linkbut didnt find any solution:
These links says that
"
the reason you're getting ellipse it's because the math on the options.add( is very basic and pretends the earth is a flat surface, just like before Copernicus. If you draw it on smaller areas you'll get a rounder circle. If you want a precise circle you'll have extend that math to proper take into account the shape of Earth "
Is there any solution to this problem.
Is use of class extending Overlay recommended in google maps v2 so that I can somehow use its onDraw(..) method.
Heatmap - Generating Simple 'HeatPoint' Google Maps Android
SO the above seems to suggest i can do this, however I am not convinced.
Here is what I am doing
CircleOptions circleOptions = new CircleOptions()
.center(center)
.radius(distance.distanceInMeters)
.strokeColor(getResources().getColor(R.color.brand_color_very_faded))
.strokeWidth(8F)
.fillColor(getResources().getColor(R.color.brand_color_faded)); // In meters
// Get back the mutable Circle
Circle circle = mMap.addCircle(circleOptions);
Which works fine, however I would really like to use a smooth gradient color, is this possible?
Or am i going to have to add a marker at each point, with a bitmap gradient (not what I want to do)?
Any help would be appreciated thanks!
The question you are referring to talks about drawing on Bitmap using Canvas, not about using CircleOptions. I suggest following it and also using TileOverlay or GroundOverlay depending on how many of these circles you may have.