question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't use markers functions with clustering

See original GitHub issue

I’m submitting a … (check one with “x”) [ ] question [ x ] any problem or bug report [ ] feature request

The plugin version: (check one with “x”) [ ] 1.4.x [ x ] 2.0.0-beta3

If you choose ‘problem or bug report’, please select OS: (check one with “x”) [ x ] Android [ ] iOS

cordova information: (run $> cordova plugin list)

cordova-custom-config 4.0.2 "cordova-custom-config"
cordova-open-native-settings 1.4.1 "Native settings"
cordova-plugin-actionsheet 2.3.3 "ActionSheet"
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-console 1.0.7 "Console"
cordova-plugin-device 1.1.6 "Device"
cordova-plugin-dialogs 1.3.3 "Notification"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-file-transfer 1.6.3 "File Transfer"
cordova-plugin-geolocation 2.4.3 "Geolocation"
cordova-plugin-googlemaps 2.0.0-beta3-20170903-1743 "cordova-plugin-googlemaps"
cordova-plugin-mixpanel 3.1.0 "Mixpanel"
cordova-plugin-network-information 1.3.3 "Network Information"
cordova-plugin-request-location-accuracy 2.2.2 "Request Location Accuracy"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.3 "StatusBar"
cordova-plugin-whitelist 1.3.2 "Whitelist"
cordova-plugin-wkwebview-engine 1.1.4-dev "Cordova WKWebView Engine"
cordova-plugin-x-socialsharing 5.1.8 "SocialSharing"
cordova.plugins.diagnostic 3.6.6 "Diagnostic"
es6-promise-plugin 4.1.0 "Promise"
ionic-plugin-deeplinks 1.0.15 "Ionic Deeplink Plugin"
ionic-plugin-keyboard 2.2.1 "Keyboard"
phonegap-plugin-push 1.10.5 "PushPlugin"
uk.co.workingedge.phonegap.plugin.launchnavigator 4.0.4 "Launch Navigator"

Current behavior: When adding the marker cluster, clicking on a markers causes: Uncaught TypeError: marker.one(...).then is not a function

Expected behavior: Should be able to use a marker like I would without clustering.

Steps to reproduce: Create a map with clustering & do something on infoWindow click. If I remove marker.one(...) it works, but how can I handle infoWindow click?

Screen capture or video record: ezgif-1-199b5123f2

(I know this is not the error since the InfoWindow opens automatically, but it’s the same kind of error)

image

Related code, data or error log (please format your code or data):

        this.map.addMarkerCluster({
          boundsDraw: false,
          markers: markers,
          icons: [
            {min: 2, max: 100, url: 'assets/img/blue.png', anchor: {x: 16, y: 16}},
            {min: 100, max: 1000, url: 'assets/img/yellow.png', anchor: {x: 16, y: 16}},
            {min: 1000, max: 2000, url: 'assets/img/purple.png', anchor: {x: 24, y: 24}},
            {min: 2000, max: 5000, url: 'assets/img/red.png', anchor: {x: 32, y: 32}}
          ]
        }).then((markerCluster: MarkerCluster) => {
          markerCluster.on(GoogleMapsEvent.MARKER_CLICK).subscribe((arr: any) => {
            console.log('marker click');
            marker = arr[1];

            marker.one(GoogleMapsEvent.INFO_CLICK).then(() => {
              console.log('info-click')
            });
          });
        });

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:27 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
wf9a5m75commented, Oct 5, 2017

Unfortunately, you still have to wait the next update. Because the PR implementation was changed after I sent the PR first time.

As the author of this plugin, I recommend you use this plugin without the @ionic-native/google-maps wrapper plugin. The wrapper plugin takes overhead (such as converting instances). It means slow (bad performance) than pure JS plugin.

1reaction
wf9a5m75commented, Sep 17, 2017

Sorry, after the discussion with the ionic team, I don’t support the @ionic-native/google-maps anymore. Please ask to the ionic-native repository.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Maps Marker Clustering not working - Stack Overflow
the MarkerClusterer constructor is in the wrong place (it is outside the initialize function, it runs before the markers are created. the ...
Read more >
How to cluster map markers | Google Cloud Blog
Marker clustering is a useful tool for visually consolidating markers, making it easier for viewers to understand a map as a whole by...
Read more >
How to Cluster Map Markers: Demo and Tutorial
The way marker clustering works is that it provides a summary marker that gives you an idea of what's “below” at closer zoom...
Read more >
Google Maps Android Marker Clustering Utility
This video discusses the use of marker clustering when your data requires a large number of data points on the map.
Read more >
Marker clustering on geospatial point maps in QuickSight
Use marker clustering to improve readability of colocated points on a map. Geospatial locations on point maps are represented using markers.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found