android - Ionic/Cordova Google Maps app crash after add two marker with different icons -


i need please, i'm building android application
use cordova google maps plugins ionic v 1.3
work fine
if add 2 marker 1 icon , other without or same icone work
problem when add 2 markers different icons
application crash without error


code :

 //create marker of begin , arrive     map.clear();     map.addmarker({       position: depart,       title: "vous êtes ici.",       //snippet: "description",       icon: {         url: "www/images/depart.png"       },       animation: plugin.google.maps.animation.bounce     });     map.addmarker({       position: arriver,       title: "l'arrivée.",       //snippet: "description",       icon: {         url: "www/images/arrive.png"       },       animation: plugin.google.maps.animation.bounce     }); 


thanks

my logcat errors log :

 e/androidruntime(11620): fatal exception: asynctask #2 e/androidruntime(11620): process: com.ionicframework.myapp468132, pid: 11620 e/androidruntime(11620): java.lang.runtimeexception: error occured while executing doinbackground() e/androidruntime(11620):        @ android.os.asynctask$3.done(asynctask.java:300) e/androidruntime(11620):        @ java.util.concurrent.futuretask.finishcompletion(futuretask.java:355) e/androidruntime(11620):        @ java.util.concurrent.futuretask.setexception(futuretask.java:222) e/androidruntime(11620):        @ java.util.concurrent.futuretask.run(futuretask.java:242) e/androidruntime(11620):        @ android.os.asynctask$serialexecutor$1.run(asynctask.java:231) e/androidruntime(11620):        @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1112) e/androidruntime(11620):        @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:587) e/androidruntime(11620):        @ java.lang.thread.run(thread.java:841) e/androidruntime(11620): caused by: java.lang.illegalstateexception: not on main thread e/androidruntime(11620):        @ maps.w.d.a(unknown source) e/androidruntime(11620):        @ maps.y.f.a(unknown source) e/androidruntime(11620):        @ maps.ad.s.b(unknown source) e/androidruntime(11620):        @ aep.ontransact(:com.google.android.gms.dynamitemodulesb:169) e/androidruntime(11620):        @ android.os.binder.transact(binder.java:361) e/androidruntime(11620):        @ com.google.android.gms.maps.model.internal.zzf$zza$zza.setvisible(unknown source) e/androidruntime(11620):        @ com.google.android.gms.maps.model.marker.setvisible(unknown source) e/androidruntime(11620):        @ plugin.google.maps.pluginmarker$1.onpostexecute(pluginmarker.java:164) e/androidruntime(11620):        @ plugin.google.maps.pluginmarker$7.doinbackground(pluginmarker.java:743) e/androidruntime(11620):        @ plugin.google.maps.pluginmarker$7.doinbackground(pluginmarker.java:698) e/androidruntime(11620):        @ android.os.asynctask$2.call(asynctask.java:288) e/androidruntime(11620):        @ java.util.concurrent.futuretask.run(futuretask.java:237) e/androidruntime(11620):        ... 4 more 

i using plugin ionic 2 , getting same issue, after digging plugin's java code tried following :

  1. i kept icon inside icon directory (eg: src/assets/icon/myicon1.png).
  2. then used during adding location marker following :

    icon : './assets/icon/myicon1.png'

    icon : './assets/icon/myicon2.png'

now working fine.


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -