harryanand060 / android-maps-extensions

Automatically exported from code.google.com/p/android-maps-extensions
0 stars 0 forks source link

NullPointerException when no IconDataProvider implementation specified #26

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Finally, got some time to try Maps Extensions for my app. Migration went 
smooth, although docs are scarce (and i can probably be considered GMaps power 
user, having thus a competitive advantage;-).

One thing that is probably worth improving is to implement some default cluster 
icons.

What i intuitively did (after updating imports) was to add this line to my code:

  googleMap.setClustering(new ClusteringSettings().addMarkersDynamically(true));

After that my app went bust:

java.lang.NullPointerException
at 
pl.mg6.android.maps.extensions.impl.BaseClusteringStrategy.getIconData(BaseClust
eringStrategy.java:68)
at 
pl.mg6.android.maps.extensions.impl.BaseClusteringStrategy.getFromCacheOrCreate(
BaseClusteringStrategy.java:59)
at 
pl.mg6.android.maps.extensions.impl.ClusterMarker.refresh(ClusterMarker.java:80)
at 
pl.mg6.android.maps.extensions.impl.ClusterRefresher.refreshAll(ClusterRefresher
.java:52)
at 
pl.mg6.android.maps.extensions.impl.GridClusteringStrategy.recalculate(GridClust
eringStrategy.java:327)
at 
pl.mg6.android.maps.extensions.impl.GridClusteringStrategy.onCameraChange(GridCl
usteringStrategy.java:92)
at 
pl.mg6.android.maps.extensions.impl.DelegatingGoogleMap$DelegatingOnCameraChange
Listener.onCameraChange(DelegatingGoogleMap.java:446)

Sure, it's trivial to grab DemoIconProvider implementation along with some 
resources from sample project, but it'd be nice to have it out of the box. 

Original issue reported on code.google.com by estee...@gmail.com on 24 Jul 2013 at 3:53

GoogleCodeExporter commented 8 years ago
Hello Taras,

The first thing to change is probably the exception that is being thrown, which 
says almost nothing about the reason. Bad, bad.

I also think it would be beneficial to have some default implementation.

Original comment by maciek.g...@gmail.com on 24 Jul 2013 at 10:50

GoogleCodeExporter commented 8 years ago

Original comment by maciek.g...@gmail.com on 25 Aug 2013 at 12:20

GoogleCodeExporter commented 8 years ago
Added DefaultClusterOptionsProvider which is used when no provider is set

Original comment by maciek.g...@gmail.com on 31 Aug 2013 at 4:07