plugins
plugins copied to clipboard
feat/google-map-utils
Google map utilities library integration.
Features:
@triniwiz @NathanWalker Hopefully I can come back to this soon but at the moment my time is becoming pretty limited. Might be worth pushing these feaures as a baseline till I get a chance to come back to this. Thoughts?
@herefishyfish thank you, If you don't mind I can finish it up. 😄
@triniwiz I don't mind. I did however notice that the iOS util tooling doesn't actually support the Icon generator for custom icons that android has available - so that makes this a bit easier again :)
I'm very interested in the clustering feature, I tried implementing it myself on the old dapriett/nativescript-google-maps-sdk plugin but failed when it came to info windows and custom markers. @herefishyfish since it seems you have better understanding of this, do you think it's possible to implement clustering with custom marker icons (static resources, not clusters) and info windows? By this I mean, do both Android and iOS support this feature?
I'm very interested in the clustering feature, I tried implementing it myself on the old dapriett/nativescript-google-maps-sdk plugin but failed when it came to info windows and custom markers. @herefishyfish since it seems you have better understanding of this, do you think it's possible to implement clustering with custom marker icons (static resources, not clusters) and info windows? By this I mean, do both Android and iOS support this feature?
Both iOS and Android suppport custom cluster icons for sure. Not so sure about cluster info windows though. For iOS you would need to create a custom renderer delegate and add in your own logic to handle the cluster icons; something like this:
@ObjCClass(GMUClusterRendererDelegate)
@NativeClass()
class GMUClusterRendererDelegateImpl extends NSObject implements GMUClusterRendererDelegate {
rendererWillRenderMarker(renderer: GMUClusterRenderer, marker: GMSMarker): void {
// Determine if marker is a cluster or not, the google example uses userData
if (marker.userData instanceof CustomMarkerData === false) {
// Set custom cluster marker if it's a cluster.
marker.icon = coolCustomMarker
}
}
}
Android you can extend the custom renderer I've created here or create your own and override the render function like so:
@NativeClass()
export class CustomClusterRenderer extends ClusterRenderer {
constructor(map: GoogleMap, clusterManager: ClusterManager) {
super(map, clusterManager);
}
override onBeforeClusterRendered(
clusterItem: com.google.maps.android.clustering.Cluster<any>,
options: com.google.android.gms.maps.model.MarkerOptions): void
{
super.onBeforeClusterRendered(clusterItem, options);
options.icon = coolCustomMarker;
}
}
I love this PR, I was looking for how to do clustering. Why is this PR not divided into smaller PRs? so we can have features faster and not have to wait for everything to be ready
@herefishyfish if everything checked off list looks good on your end we could publish a minor version bump with this and handle KML in separate PR, lemme know your thoughts?
@NathanWalker Heatmaps and clustering are in a pretty good state. GeoJson will most likely get refactored with the KML implementation.
I think there are a couple of stylistic differences between @triniwiz google-maps and how I have implemented the features and would like to get his aproval over anything else before we commit this PR. However I am perfectly okay with handling the KML/GeoJson part in a seperate PR and think we can push this for sure.
Hi, has @triniwiz expressed his approval?
@tommag21 I'll wrap this up soon, sorry some other things came up.