ionic-team / ionic-team/ionic-native-google-maps
Base64 Encoded Icon cannot read property width of undefined
- Lingua principale
- TypeScript
- Stelle
- 215
- Fork
- 119
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
**I'm submitting a ...** (check one with "x")
- [ ] question
- [x ] any problem or bug report
- [ ] feature request
**If you choose 'problem or bug report', please select OS:** (check one with "x")
- [x ] **Android**
- [ ] **iOS**
- [ ] **Browser**
**cordova information:** (run `$> cordova plugin list`)
```
TypeError: Cannot read property 'width' of undefined
zone.js:690
message:"Cannot read property 'width' of undefined"
stack:"TypeError: Cannot read property 'width' of undefined
at Map. (http://localhost/plugins/cordova-plugin-googlemaps/www/Map.js:1487:63)
at http://localhost/plugins/cordova-plugin-googlemaps/www/commandQueueExecutor.js:63:21
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost/polyfills.js:3492:30)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (http://localhost/polyfills.js:3249:47)
at http://localhost/polyfills.js:3997:38
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (http://localhost/polyfills.js:3527:35)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (http://localhost/polyfills.js:3294:51)
at drainMicroTaskQueue (http://localhost/polyfills.js:3707:39)"
**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.28.0",
"@ionic-native/device": "^5.28.0",
"cordova-android": "^8.1.0",
"cordova-androidx-build": "^1.0.4",
"@ionic-native/google-maps": "^5.27.0-beta-20200630",
"cordova-plugin-googlemaps": "git+https://github.com/mapsplugin/cordova-plugin-googlemaps.git#multiple_maps",
```
**Current behavior:**
Adding a marker using Base64 format produces an error. The marker is shown on the map as expected but the error mentioned above is produced.
**Expected behavior:**
The marker should be draw on the map with out producing error.
**Screen capture or video record:**
**Related code, data or error log (please format your code or data):**
```
loadMap() {
// This code is necessary for browser
Environment.setEnv({
'API_KEY_FOR_BROWSER_RELEASE': '(your api key for `https://`)',
'API_KEY_FOR_BROWSER_DEBUG': '(your api key for `http://`)'
});
let mapOptions: GoogleMapOptions = {
camera: {
target: {
lat: 43.0741904,
lng: -89.3809802
},
zoom: 18,
tilt: 30
}
};
this.map = GoogleMaps.create('map_canvas', mapOptions);
// let icon='blue';
let icon= 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAACVUlEQVRIS8WWjVXCMBRGwwTqBMIEuAG4ARuIE6gTKBOgEyAT4AbABjKBMIE/C+h3m6S2pWlJ8BzfOTkpad6770teEzom3bZy/VbrpYTopDjJZ6w2c77X6p9j46SCUXvuYDxHq04BZ2rPHXa3y/DRqlPAmdqZW+hrkMZEq44F52q3oGTdrjEpqmPBudoxKVBVKqsU1THgPbW+klNUt4GHCn6idqEGuMveerUeXFGtNTCvah9qaz+n2gMmKMGBnLrfjPFcMirZ7231XUF19RUJkIhPZqXnT8AM9Osy62v0VPihUqIfjWwx1RkJvbxIpjArhabfbEJ6zQYwysiiT3CW8kJ6Q4BgqMALEnqVNAqQZGSkM/R7nMOBLhZ/B/ZQeg9V/1EsrpLy5dIqP8aAXV6WlQIlZrWq/wzeBK0DM3Y0vA0aAh8FPwTaBC7B2W8+qUOMT4l9dYUUrJK2k4tCOHl7O7zK+Xx69nbWU/iebgKz1+9E+OYPToR1fqOe+SquujeBWdzlYGBPohhjW9b2lGbRa72bwLdyml5d2auvaPyeTOzIw4MxzCkal8h8no3cqT3WJd0ExuFmOjXmlhRIXbnfKZQ7hfJ4HDTM8wVIMi6xJ01y3mV8E5glGlDRGIEKS75DrAtFn/0DA3x/b0ddZbPgGt23JnBW0agpKPzUGCvhoT4iv1HG9Zodtc6HGBTYnoXAXc3UR5SbBwK1d8y+8RUAzxNwU2orOwQeyolF/lLT7mUqQ8BqCj4Bt+j1lR0Cs3Sopt8GFLYNF/2JU7K2k6stePL7fwP/AER2xy+mY1/QAAAAAElFTkSuQmCC';
let marker: Marker = this.map.addMarkerSync({
title: 'Ionic',
icon: icon,
animation: 'DROP',
position: {
lat: 43.0741904,
lng: -89.3809802
}
});
marker.on(GoogleMapsEvent.MARKER_CLICK).subscribe(() => {
alert('clicked');
});
}
}`
```
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Reproduce the issue with the provided addMarkerSync call and Base64 icon, then start at www/Map.js:1487 where the TypeError is reported. Check the related commandQueueExecutor.js entry if needed, and consider the issue done when the marker still renders without producing the width error.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- mobile-dev
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100