Closed dxshindeo closed 7 years ago
@dxshindeo that's not the correct way to override a class' method in nativescript, please check https://docs.nativescript.org/runtimes/android/generator/extend-class-interface it goes as follow
const CustomClusterRenderer = dis.clustering.view.DefaultClusterRenderer.extend({
//constructor
init: function () {},
onBeforeClusterItemRendered: function (item, markerOptions) {
console.log("setup");
markerOptions.alpha(0.8);
markerOptions.flat(true);
markerOptions.rotation(item.rotation);
var icon = new Image();
icon.imageSource = imageSource.fromResource('icon_location');
var androidIcon = com.google.android.gms.maps.model.BitmapDescriptorFactory.fromBitmap(icon.imageSource.android);
markerOptions.icon(androidIcon);
}
});
var renderer = new CustomClusterRenderer(app.android.context, dis.gMap, dis.cluster_manager);
Thank you, this worked!!! :)
It compiles without errors, and when I do
renderer.setMinClusterSize(1);
it sets it accordingly. However, I get the default markers and default cluster style. So I am console.logging the function, but it is not logging out anything. Is this implemented correctly?