Skip to content

Cannot customize marker with base64 png url #49

@yiannis-spyridakis

Description

@yiannis-spyridakis

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');

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions