ionic-team / ionic-native-google-maps

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

Ionic 4: Icon markers not shown correctly on Android #300

Closed eviv3k closed 4 years ago

eviv3k commented 4 years ago

I'm submitting a...

If you choose 'problem or bug report', please select OS:

Cordova Information:

cordova-background-geolocation-lt 3.4.2 "BackgroundGeolocation" cordova-open-native-settings 1.5.2 "Native settings" cordova-plugin-background-fetch 5.6.1 "CDVBackgroundFetch" cordova-plugin-background-mode 0.7.3 "BackgroundMode" cordova-plugin-badge 0.8.8 "Badge" cordova-plugin-camera 4.1.0 "Camera" cordova-plugin-camera-preview 0.11.1 "cordova-plugin-camera-preview" cordova-plugin-compat 1.2.0 "Compat" cordova-plugin-device 2.0.3 "Device" cordova-plugin-dialogs 2.0.2 "Notification" cordova-plugin-file 6.0.2 "File" cordova-plugin-file-transfer 1.7.1 "File Transfer" cordova-plugin-flashlight 3.2.0 "Flashlight" cordova-plugin-googlemaps 2.7.0 "cordova-plugin-googlemaps" cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard" cordova-plugin-ionic-webview 4.1.3 "cordova-plugin-ionic-webview" cordova-plugin-local-notification 0.9.0-beta.2 "LocalNotification" cordova-plugin-network-information 2.0.2 "Network Information" cordova-plugin-save-image 0.3.0 "SaveImage" cordova-plugin-screen-orientation 3.0.2 "Screen Orientation" cordova-plugin-splashscreen 5.0.3 "Splashscreen" cordova-plugin-statusbar 2.4.3 "StatusBar" cordova-plugin-vibration 3.1.1 "Vibration" cordova-plugin-whitelist 1.3.4 "Whitelist" cordova.plugins.diagnostic 5.0.1 "Diagnostic"

Current behavior: I use @ionic-native/google-maps and cordova-plugin-googlemaps@2.7.0 When the marker icon should be shown, it will shown as the default red marker instead, when I use: this.map.addMarker({ icon: { url: '/assets/icon/startDrive.png' }, position: latLng });

Marker Icons not shown correctly url: '/assets/icon/startDrive.png'

What is the solution to this?

Thanks

wf9a5m75 commented 4 years ago

Hey, could you check demo, documents, or more testing before asking? https://mapsplugin.github.io/ionic-googlemaps-quickdemo-v4/

eviv3k commented 4 years ago

Thank you! :) I used: url: './assets/icon/startDrive.png'

wf9a5m75 commented 4 years ago

If the path start with /, it means the file path on the device. Start with ./ or without anything (i.e, assets/icon/startDrive.png), means relative path from the url.

eviv3k commented 4 years ago

I used url: assets/icon/startDrive.png. not correctly for android but iOS only. Also used url: ./assets/icon/startDrive.png. it correctly Android.