ionic-team / ionic-team/ionic-native-google-maps
Base64 Encoded Icon cannot read property width of undefined
- Langage dominant
- TypeScript
- Étoiles
- 215
- Forks
- 119
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
**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');
});
}
}`
```
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Reproduisez le problème avec l’appel addMarkerSync et l’icône Base64 fournis, puis commencez par www/Map.js:1487, où le TypeError est signalé. Vérifiez l’entrée correspondante de commandQueueExecutor.js si nécessaire, et considérez le problème comme résolu lorsque le marqueur continue de s’afficher sans produire l’erreur width.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- typescript
- Domaine
- mobile-dev
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100