android - Google Map API v2 Heatmap not showing all locations -
i'm trying out google api v2 heatmap (android) introduced february , it's not working entirely. i'm not sure if it's same problem google maps api v2 heatmap won't reliably display (and can't contact him comments because don't have enough rep.. :c ).
using locations file
anyway, trying app googlemap , same locations in guide (https://developers.google.com/maps/documentation/android/utility/heatmap) , when launch it, can see 3/5 locations.
i tried adding more points , still, it's consistently not showing them all, can't see pattern or something. code same in guide.
private void addheatmap() { list<latlng> list = null; // data: latitude/longitude positions of police stations. try { list = readitems(r.raw.police_stations); } catch (jsonexception e) { toast.maketext(this, "problem reading list of locations.", toast.length_long).show(); } // create heat map tile provider, passing latlngs of police stations. mprovider = new heatmaptileprovider.builder() .data(list) .build(); // add tile overlay map, using heat map tile provider. moverlay = mmap.addtileoverlay(new tileoverlayoptions().tileprovider(mprovider)); } private arraylist<latlng> readitems(int resource) throws jsonexception { arraylist<latlng> list = new arraylist<latlng>(); inputstream inputstream = getresources().openrawresource(resource); string json = new scanner(inputstream).usedelimiter("\\a").next(); jsonarray array = new jsonarray(json); (int = 0; < array.length(); i++) { jsonobject object = array.getjsonobject(i); double lat = object.getdouble("lat"); double lng = object.getdouble("lng"); latlng latlng = new latlng(lat, lng); list.add(latlng); } return list; }
trying weighted locations had same result, of them showing , not.
using locations "onclick"
in case, normal latlng added , map updated until got equator , stopped :p.
for case of weightedlatlngs, didn't update/show :(
that's it... don't know more information, whether it's api, device or else.
does know why might happen and/or solution ?
thank in advance !
btw, i'm using android 4.0.4 on samsung galaxy s duos if may prove useful..
the googlemaps api heatmap allows 1,000 plotted points. can reduced filtering out original data or converting "weighted locations".
Comments
Post a Comment