Open ebhsgit opened 3 years ago
@ebhsgit I installed from your fork and I no longer get custom map marker icons. It always uses the default red pin from Google maps. Can you please test on your end to see if you have a similar problem?
The problem was that I was using a relative path ('./www/img/myimg.png'
). When I switched to the full path (${cordova.file.applicationDirectory}www/img/myimg.png
) then it worked. Of course the relative path was working before I switched to this fork, so perhaps you could still check that too.
@CodeWithOz
Please note my fork is not intended for production usage.
That said, there shouldn't be any changes related to map markers in the fork.
If you find the issue. Feel free to suggest a PR
I also have the issue with blank map. Works when AGP 4.0.2 is used, but is broken with AGP 4.1.x and above.
@wf9a5m75 please merge and publish a new version asap!
Kinda strange, because i don't see any changes that would cause that, but i can confirm what @CodeWithOz said. My Markers that are set via url: './assets/...'
doesn't work anymore with your PR 🤔
I have not tested this fix but if it works please try to merge it so that we can use official release of this plugin and do not have to hack the solution ourselves in code. Without fix we are stuck to cordova-android@9.1.0 and can not use latest cordova-android@10.0.0 which needs Android Gradle Plugin (AGP) version 4.2.2. Thank you!
There are no changes in this branch related to markers.
This pr is branched from master
.
Maybe you guys are using a different branch? eg: multiple_maps
, there are lots of other changes between master and multiple_maps
Could you try the 20210804 branch? I'm working on the next version recently, and don't touch v2.x these days. But it seems I've tried to improve something.
No i'm using your branch @ebhsgit 🤔 Before i was using Version 2.7.1
.
@wf9a5m75 i think this should be fixed in a hotfix 2.7.2
as it blocks the migration to cordova-android@10
@wf9a5m75 i just tried to install from your branch. I got a lot of build errors, for example:
L.92: Cannot resolve symbol 'viewPlugins'
L.102: Inconvertible types; cannot cast 'org.apache.cordova.PluginEntry' to 'plugin.google.maps.PluginMarker'
L.410: Cannot resolve method 'getGoogleMap' in 'PluginMap'
in PluginMarker.java
and lots of Errors in CordovaGoogleMaps.java, which seems all be related to:
L.52: Cannot resolve symbol 'MyPluginLayout'
All in all 66 Errors
@CodeWithOz @EinfachHans
Not sure what the issue is with icons.
The changes are simple, and are definitely not related to markers.
@ebhsgit give it a try yourself 😃
I am not experiencing any issues with markers
Do you add at least one via ./assets/...
?
Yup.
eg:
./assets/imgs/map/markers/start.png
Do you just set the icon: './assets/imgs/map/markers/start.png'
or do you set more options like size and anchor?
icon: {
url: '....',
size: '.....'
}
Strange, Version 2.7.1
works fine, but when i install from this PR directly it doesn't
https://github.com/mapsplugin/cordova-plugin-googlemaps/pull/2872#issuecomment-893316041
I was able to build the plugin in ionic v5 project at least.
Did you rebuild with command ionic cordova clean
then ionic cordova build android
?
@wf9a5m75 I completely removed the platforms
, plugins
, www
, node_modules
folder and the package_lock.json
and installed and build everything from zero
Okay i debugged a bit more, looks like this Marker Problem is cordova-android
related: https://github.com/apache/cordova-android/issues/1316 - Thanks 😊
Sadly still white map :(
It really needs to be fixed soon, because the switch to Android 11 (API Level 30) will be required by Google from 1st Nov 2021. Can the current fix be used in production at least?
The fix https://github.com/mapsplugin/cordova-plugin-googlemaps/commit/1de03cdb14f0239c23ac88d59ea296fa185be56e seemes to solve the white map issue but unfortunately, the app crashes when loading custom markers.
Actually, this fix by @ebhsgit seems to work with a clean install (reinstall platform and plugins, and also remove package-lock.json) https://github.com/mapsplugin/cordova-plugin-googlemaps/commit/0b8ea76ad34fb2a202a9de1b9d0e051a82ad9443. With the merge commit https://github.com/mapsplugin/cordova-plugin-googlemaps/commit/1de03cdb14f0239c23ac88d59ea296fa185be56e I got some build errors as pointed out by @EinfachHans
@wf9a5m75 any timeline on when this will be merged. Many of us are waiting for the fix since switch to Android 11 (API Level 30) will be required by Google from 1st Nov 2021.
Could you please provide your thoughts upon this.
Thanks
@alexp25 comment out line 1150 and 1151 (result.image.recycle(),result.image = null) in the file src/android/plugin/google/maps/PluginMarker.java then custom markers work fine
@alexp25 @lrobak0 can someone please help me installing commit 1de03cd
Currently I am installing via below command cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps#1de03cdb14f0239c23ac88d59ea296fa185be56e
Is this correct?
@lrobak0 thanks for the quick response.
If I get it right you meant, cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps#0b8ea76ad34fb2a202a9de1b9d0e051a82ad9443
Quick questions: 1) Did you get any build errors post install? 2) Is the Map now rendering? 3) Did you test in production?
@sachi097 you can also define it in the package.json: "cordova-plugin-googlemaps": "git+https://github.com/mapsplugin/cordova-plugin-googlemaps.git#0b8ea76ad34fb2a202a9de1b9d0e051a82ad9443"
In my case, having a large project with lots of plugins, lots of features, custom markers, interactions:
yes,
@alexp25 @lrobak0 thanks for your answers.
As per @lrobak0 comment installed the plugin via cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps#0b8ea76ad34fb2a202a9de1b9d0e051a82ad9443
Summary:
PR #2887 will fix the customer marker issue mentioned here with cordova-android 10+, without needing to set AndroidInsecureFileModeEnabled
Hello everyone, do you know when you will do the merge of this PR?
Are there any estimates when this will be merged?
Kindly Merge
thank you for the support :)
Hi when can you merge this branch?
@alexp25 @lrobak0 thanks for your answers.
As per @lrobak0 comment installed the plugin via cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps#0b8ea76ad34fb2a202a9de1b9d0e051a82ad9443
Summary:
- Got build errors initially, then uninstalled all the plugins and reinstalled (including https://github.com/mapsplugin/cordova-plugin-googlemaps#0b8ea76ad34fb2a202a9de1b9d0e051a82ad9443), deleted www folder and reinstall platform (ionic cordova platform add android@10.1.0). Post this build passed like a charm.
- The map is rendering properly.
- Currently, my app is in development phase. I will provide feedback once I test in production.
Map works like charm in the production.
Any updates on merging this? Just updated my cordova to android 10 and faced this issue. Testing the PR right now.
Fix #2871
From AGP 4.1.+
assert
keyword/statements are enabled by the compile through code rewrite.Which is causing PluginMap to fail
The issue is caused by
PluginMap
being initialised 2 times. The 2nd time it is initialised,CordovaPlugin.privateInitialize
hasassert
to prevent this.This PR removes initialising the
PluginMap
inCordovaGoogleMaps.getMap
, because when it is added toPluginManager
it will be initialised then.NOTE
Although the relevant code in
PluginManager
andCordovaPlugin
has not been changed for many years. The plugin's codebase works for older cordova-android versions because they use older AGP.In these older versions,
assert
keyword/statement do nothing
Thank you , this fix Blank White Map Screen , but , now dont fire , plugin.google.maps.event.PANORAMA_READY @wf9a5m75 Any help would be appreciated.
i have
"cordova-android": "^10.1.2", "cordova-plugin-androidx-adapter": "^1.1.3", "cordova-plugin-googlemaps": "^2.7.1",
google map not load display white screen
any one help me
Replace these files CordovaGooleMaps PluginMap
Copy here: ....\
From: subha-menuHuts @.> Sent: Thursday, December 8, 2022 8:02 AM To: mapsplugin/cordova-plugin-googlemaps @.> Cc: Guillermo Franco @.>; Comment @.> Subject: Re: [mapsplugin/cordova-plugin-googlemaps] Fix #2871 - Resolve blank map when running compiled with latest cordova-android (which uses AGP 4.1.3) (#2872)
i have
"cordova-android": "^10.1.2", "cordova-plugin-androidx-adapter": "^1.1.3", "cordova-plugin-googlemaps": "^2.7.1",
google map not load display white screen
any one help me
— Reply to this email directly, view it on GitHubhttps://github.com/mapsplugin/cordova-plugin-googlemaps/pull/2872#issuecomment-1342623330, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIJPNTMDXNQGLISIN27V5IDWMHE5PANCNFSM45IT6X7Q. You are receiving this because you commented.Message ID: @.***>
Fix #2871
From AGP 4.1.+
assert
keyword/statements are enabled by the compile through code rewrite.Which is causing PluginMap to fail
The issue is caused by
PluginMap
being initialised 2 times. The 2nd time it is initialised,CordovaPlugin.privateInitialize
hasassert
to prevent this.This PR removes initialising the
PluginMap
inCordovaGoogleMaps.getMap
, because when it is added toPluginManager
it will be initialised then.NOTE
Although the relevant code in
PluginManager
andCordovaPlugin
has not been changed for many years. The plugin's codebase works for older cordova-android versions because they use older AGP.In these older versions,
assert
keyword/statement do nothing