Open hrhosni opened 2 years ago
I was also facing similar issue. My problem was with the correct path to the image.
This is my solution:
const icon = './www/assets/icons/vehicles/vehicle-010.png';
And this works for IOS:
"cordova-ios": "^6.2.0",
The above by @pdanysz does not work unfortunately.
@wf9a5m75 would appreciate your take on this
@pdanysz @hrhosni have you tried this
...
url: `${cordova.file.applicationDirectory}www/img/my_location.png`,
...
That works for me.
@CodeWithOz
Thanks for the above. It works on Android but not on iOS.
I get the following on iOS:
(error)There is no file at '/var/containers/Bundle/Application/9272787B-8D47-4981-9E03-C3A7EF202F75/appName.app/www/img/my_location.png'
Hey, I had the same issue. This is not a solution, but a workaround. I hosted the images online and replaced the URL with a direct link to the image.
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
)Current behavior: The marker is showing as the default (red) Google Maps marker instead of the png image I am providing (see screenshot below). It broke after updating to cordova-ios@6.2.0.
Expected behavior: It should show the png image I provided as the marker.
Screen capture or video record:
Related code, data or error log (please format your code or data):
I see the following error in the console:
map_0_16186021532 – "Can not load image from 'app://localhost/img/my_location.png'."
in cordova.js:1413Here's the piece of code that puts the marker on the map:
Thank you.