ionic-team / ionic-team/capacitor-google-maps

Cannot customize marker with base64 png url

Open
#49 2 comments 0 reactions 0 assignees View on GitHub
triage
Dominant language
TypeScript
Stars
32
Forks
47
PR merge metrics
No merged PRs in 30d

Description

## Bug Report
I am adding markers with code like this:

```
const marker: Marker = {
coordinate: gasStation.location,
iconUrl: 'data:image/png;base64,...', // Base64 png url, tested and working with the js api, cordova plugin
iconSize: {
width: 38,
height: 48
},
}
const markerId = await nativeMap.addMarker(marker);
```

The image is ignored, I just get the standard marker icon.

Is this a known missing feature? By investigating, I was able to find some discussions regarding base64 svg icons but no direct confirmation that data urls are unsupported.

Can you please confirm?

### Plugin(s)
@capacitor/google-maps

### Capacitor Version
```
Latest Dependencies:

@capacitor/cli: 6.1.2
@capacitor/core: 6.1.2
@capacitor/android: 6.1.2
@capacitor/ios: 6.1.2

Installed Dependencies:

@capacitor/cli: 6.1.2
@capacitor/core: 6.1.2
@capacitor/android: 6.1.2
@capacitor/ios: 6.1.2

[success] iOS looking great! 👌
[success] Android looking great! 👌
```

### Platform(s)
Android
IOS? (only tested on Android so far)

### Current Behavior
Data urls are ignored when adding Markers.

### Expected Behavior
A workaround or confirmation that this is expected.

### Other Technical Details
The data url is exported from an HTML canvas like so:
```
// Export to base64 string
const ret = canvas.toDataURL('image/png');
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.