ionic-team / ionic-native-google-maps

Google maps plugin for Ionic Native
Other
221 stars 125 forks source link

Ionic 4: cluster markers not shown correctly #264

Closed services4smb closed 4 years ago

services4smb commented 4 years ago

I'm submitting a ... (check one with "x")

If you choose 'problem or bug report', please select OS: (check one with "x")

cordova information: (run $> cordova plugin list)

cordova-plugin-device 2.0.2 "Device"
cordova-plugin-googlemaps 2.7.0-20191107-1035 "cordova-plugin-googlemaps"
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.0.1 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"

If you use @ionic-native/google-maps, please tell the package.json (only @ionic-native/core and @ionic-native/google-maps are fine mostly)

"@ionic-native/core": "^5.5.1",
"cordova-plugin-googlemaps": "git+https://github.com/mapsplugin/cordova-plugin-googlemaps.git#multiple_maps",

Current behavior:

This might somehow relate to the problem solved last week in #262 since it again is marker icons that aren't shown correctly.

When the cluster marker icon should be shown, it will show as the default red marker instead, when I use: url: './assets/image/small.png'

If the cluster marker icon is moved to an external location, it works correctly: url: 'https://www.jagtlog.com/images/apps/small.png'

this.map.addMarkerCluster({
      boundsDraw: true,
      maxZoomLevel: 12,
      markers: data,
      icons: [{
          min: 3,
          max: 15,
          url: 'https://www.jagtlog.com/images/apps/small.png'
          // url: './assets/image/small.png'
        },{
          min: 16,
          max: 200,
          url: 'https://www.jagtlog.com/images/apps/large.png'
          // url: './assets/image/large.png'
       }]
})

Expected behavior:

No matter if the cluster icon is placed in assets or on a external url, it show be shown correctly.

Screen capture or video record:

Cluster icons not shown correctly (url: './assets/image/small.png'): Cluster_icons_not_ok

Cluster icons shown correctly (url: 'https://www.jagtlog.com/images/apps/small.png'): Cluster_icons_ok Related code, data or error log (please format your code or data):

Repo: https://bitbucket.org/nicedevice/googlemaps/

EinfachHans commented 4 years ago

same Issue here. Markers from my assets Folder are always displayed as the default red Marker Icon. @wf9a5m75

wf9a5m75 commented 4 years ago

As far as I suggested in https://github.com/ionic-team/ionic-native-google-maps/issues/262, do the same thing.

services4smb commented 4 years ago

@wf9a5m75 thanks for your quick respons, but I have already done the same as in #262. Or do you want me to build a apk for debugging?

$> ionic cordova plugin rm cordova-plugin-googlemaps

$> ionic cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps#multiple_maps
wf9a5m75 commented 4 years ago

I see. Please share your project files on GitHub repository.

services4smb commented 4 years ago

I have now replicated the issue to my demo app, so the issue above is updated with Cordova information, package.json and added bitbucket repo.

EinfachHans commented 4 years ago

Just tested again. Not only Marker Cluster. Normal Marker from assets are always displayed as the default red Google Marker too. Any Updates on this?

services4smb commented 4 years ago

@HansKrywaa the issue with normal markers was solved last week by @wf9a5m75 in #262

Re-install the plugin using commands below should solve the problem (solved mine):

$> ionic cordova plugin rm cordova-plugin-googlemaps

$> ionic cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps#multiple_maps
EinfachHans commented 4 years ago

@services4smb I already reinstalled, removed platform, plugins, etc. but i have the default red marker for every marker (normal, cluster-marker, cluster-overviwe-marker) which i try to load from assets.

Can you reinstall again and confirm it works for you?

services4smb commented 4 years ago

@HansKrywaa before I jump into re-installing, could you please share how you ref. to the icon from assets? I have something like this:

icon: {
    url: './assets/image/map_marker_crosshair_orange.png'
}
EinfachHans commented 4 years ago

I had the same, but without the trailing ./ But i already tested with every possible ref's

services4smb commented 4 years ago

@HansKrywaa after re-installing the plugin in my demo project everything works as expected eg. custom marker is shown on my A-B page, but the custom cluster icon still doesn't work (show the normal red marker).

How is your '$ cordova plugin list' and 'package.json'?

cordova-plugin-googlemaps 2.7.0-20191107-1035 "cordova-plugin-googlemaps"
"@ionic-native/core": "^5.5.1",
"cordova-plugin-googlemaps": "git+https://github.com/mapsplugin/cordova-plugin-googlemaps.git#multiple_maps"
EinfachHans commented 4 years ago

I will check it again tomorrow and give you feedback @services4smb

EinfachHans commented 4 years ago

@services4smb Okay my fault. It's working for normal Marker. But it's not working for every Marker in the Marker Cluster (normal and Group) like you said.

services4smb commented 4 years ago

@wf9a5m75 any updates to share on this issue?

rdiezdev commented 4 years ago

same issue here!

services4smb commented 4 years ago

@wf9a5m75 any updates to share on this issue? Are you missing anything, or is it a matter of time?

@HansKrywaa and @holaktal3 have the same issues, so a solution would be greatly appreciated.

EinfachHans commented 4 years ago

I just created a PR to fix this Issue: https://github.com/mapsplugin/cordova-plugin-googlemaps/pull/2705

@services4smb @holaktal3 Can you check if it works for you?

services4smb commented 4 years ago

@HansKrywaa not sure I'm doing it right, but an re-installation of the plugin using the commands below, didn't solve my issues:

$> ionic cordova plugin rm cordova-plugin-googlemaps

$> ionic cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps#multiple_maps
EinfachHans commented 4 years ago

@services4smb you have to reinstall via my PR until it isn't merged. I think it works via ionic cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps/pull/2705

EinfachHans commented 4 years ago

@services4smb or if installing over the pr doesn't work, install it via my Fork:

ionic cordova plugin add https://github.com/HansKrywaa/cordova-plugin-googlemaps#marker_cluster_icons

Remember removing it before

services4smb commented 4 years ago

Thanks @HansKrywaa it works perfectly with your Fork.

@wf9a5m75 will you do the merge of changes made by @HansKrywaa ? And when done, please close this issue.

EinfachHans commented 4 years ago

My PR was merged. Can you check again and close this Issue when resolved?