You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
-219Lines changed: 0 additions & 219 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -123,225 +123,6 @@ By default, the `Source` is set to `Source.DEFAULT`, but you can also specify `S
123
123
124
124
</details>
125
125
126
-
<details>
127
-
<summary>Migration Guide from v0.x to 1.0</summary>
128
-
129
-
### Migrating from v0.x to 1.0
130
-
131
-
Improvements made in version [1.0.0](https://github.com/googlemaps/android-maps-utils/releases/tag/1.0.0) of the library to support multiple layers on the map caused breaking changes to versions prior to it. These changes also modify behaviors that are documented in the [Maps SDK for Android Maps documentation](https://developers.google.com/maps/documentation/android-sdk/intro) site. This section outlines all those changes and how you can migrate to use this library since version 1.0.0.
132
-
133
-
134
-
### Adding Click Events
135
-
136
-
Click events originate in the layer-specific object that added the marker/ground overlay/polyline/polygon. In each layer, the click handlers are passed to the marker, ground overlay, polyline, or polygon `Collection` object.
137
-
138
-
```java
139
-
// Clustering
140
-
ClusterManager<ClusterItem> clusterManager =// Initialize ClusterManager - if you're using multiple maps features, use the constructor that passes in Manager objects (see next section)
GeoJsonLayer geoJsonLayer =// Initialize GeoJsonLayer - if you're using multiple maps features, use the constructor that passes in Manager objects (see next section)
KmlLayer kmlLayer =// Initialize KmlLayer - if you're using multiple maps features, use the constructor that passes in Manager objects (see next section)
158
-
kmlLayer.setOnFeatureClickListener(feature -> {
159
-
// Listen for clicks on KML features here
160
-
});
161
-
```
162
-
163
-
#### Using Manager Objects
164
-
165
-
If you use one of Manager objects in the package `com.google.maps.android` (e.g. `GroundOverlayManager`, `MarkerManager`, etc.), say from adding a KML layer, GeoJson layer, or Clustering, you will have to rely on the Collection specific to add an object to the map rather than adding that object directly to `GoogleMap`. This is because each Manager sets itself as a click listener so that it can manage click events coming from multiple layers.
166
-
167
-
For example, if you have additional `GroundOverlay` objects:
This same pattern applies for `Marker`, `Circle`, `Polyline`, and `Polygon`.
190
-
191
-
### Adding a Custom Info Window
192
-
If you use `MarkerManager`, adding an `InfoWindowAdapter` and/or an `OnInfoWindowClickListener` should be done on the `MarkerManager.Collection` object.
[A bug](https://github.com/googlemaps/android-maps-utils/issues/90) was fixed in v1 to properly clear and re-add markers via the `ClusterManager`.
261
-
262
-
For example, this didn't work pre-v1, but works for v1 and later:
263
-
264
-
```java
265
-
clusterManager.clearItems();
266
-
clusterManager.addItems(items);
267
-
clusterManager.cluster();
268
-
```
269
-
270
-
If you're using custom clustering (i.e, if you're extending `DefaultClusterRenderer`), you must override two additional methods in v1:
271
-
*`onClusterItemUpdated()` - should be the same* as your `onBeforeClusterItemRendered()` method
272
-
*`onClusterUpdated()` - should be the same* as your `onBeforeClusterRendered()` method
273
-
274
-
**Note that these methods can't be identical, as you need to use a `Marker` instead of `MarkerOptions`*
275
-
276
-
See the [`CustomMarkerClusteringDemoActivity`](demo/src/main/java/com/google/maps/android/utils/demo/CustomMarkerClusteringDemoActivity.java) in the demo app for a complete example.
// Note: this method runs on the UI thread. Don't spend too much time in here (like in this example).
337
-
markerOptions.icon(getClusterIcon(cluster));
338
-
}
339
-
...
340
-
}
341
-
```
342
-
343
-
</details>
344
-
345
126
## Contributing
346
127
347
128
Contributions are welcome and encouraged! If you'd like to contribute, send us a [pull request] and refer to our [code of conduct] and [contributing guide].
0 commit comments