mapsplugin / cordova-plugin-googlemaps

Google Maps plugin for Cordova
Apache License 2.0
1.66k stars 913 forks source link

HTML Info Window Occasionally Shows Raw HTML behind Rendered HTML #1376

Closed KimberleeDArmstrong closed 7 years ago

KimberleeDArmstrong commented 7 years ago

I am using the HTML Info Windows in the #multiplemaps (v2) version of the plugin. I can click on a marker one time and get the properly rendered Info Window. Then later click the same marker and it displays the raw HTML behind it. Any ideas what I could be doing to cause this? image image

wf9a5m75 commented 7 years ago

How many times occur this issue? Is this rare case or almost every times?

KimberleeDArmstrong commented 7 years ago

It is a rare case. Once it happens though, it happens every time until I reload the map. Then it won't occur again for a while.

KimberleeDArmstrong commented 7 years ago

Any thoughts on how to fix this? Our testers are hitting it on about 10% of their clicks and we can't release this project with it like this. :-(

wf9a5m75 commented 7 years ago

I guess your HTML does contain something strange value in string. screen shot 2017-04-14 at 9 05 17 am https://github.com/mapsplugin/cordova-plugin-googlemaps/blob/multiple_maps/www/InfoWindow.js#L76-L81

See the above code. If the browser detects as String, just inert it to innerHTML. After that, that is browser's work. Not plugin's work.

KimberleeDArmstrong commented 7 years ago

I understand what you are saying. Its just weird because the exact same title string sometimes works and sometimes doesn't.
Unfortunately we are close to ditching this project and going back to the Google JS API due to stability issues :-( I really don't want to do this. I was going to present an option to management as a last chance option, but wanted to check with you first. If I uploaded the entire app so that you can get to all the code, would you have any interest in looking for code issues in my app to help us make it more stable? Let me know what you are thinking?

Some issues we are seeing... -HTML InfoWindow displaying non rendered HTML (issue above) -InfoWindow gets stuck open and can not be closed. Even map.clear() does not remove it. Have to force quit. -App Crashes when panning and zooming quickly. -Image overlay get stuck on map and does not remove (I have a code hack in to workaround this issue so not a huge deal) -PolyLines aren't being removed from map on remove call.

wf9a5m75 commented 7 years ago

Ok. Please share your repository. And could you tell me how many days do you have? As you may know, I have my real job. I can not commit full time on your project.

KimberleeDArmstrong commented 7 years ago

That is so nice of you. I completely understand. I can probably go 1-2 weeks? We can "buy you some beers" if you can get it stable. :-)

Regards,

Kimberlee Armstrong Software Engineer dataVoice International Inc. 972-390-8808 X144

From: "Masashi Katsumata" notifications@github.com To: "mapsplugin/cordova-plugin-googlemaps" cordova-plugin-googlemaps@noreply.github.com Cc: "kim" kim@datavoiceint.com, "Author" author@noreply.github.com Sent: Wednesday, April 19, 2017 11:11:23 AM Subject: Re: [mapsplugin/cordova-plugin-googlemaps] HTML Info Window Occasionally Shows Raw HTML behind Rendered HTML (#1376)

Ok. Please share your repository. And could you tell me how many days do you have? As you may know, I have my real job. I can not commit full time on your project.

— You are receiving this because you authored the thread. Reply to this email directly, [ https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1376#issuecomment-295326991 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/AIygBCDbrAaTOfxbLn4kYVVWV-30ShoWks5rxjIrgaJpZM4Mup-s | mute the thread ] .

wf9a5m75 commented 7 years ago

Sounds great. Let's debug your project.

Please give me 'write' permission when you share your repository with me. I don't affect your main code on the master branch. I will create another branch for debugging.

wf9a5m75 commented 7 years ago

By the way, if you need to sign a NDA, send me it to my e-mail address.

KimberleeDArmstrong commented 7 years ago

I think we have an NDA on file from before. I shared the repo. We might have to look at getting you ssh access to our machine. Thanks!

Regards,

Kimberlee Armstrong Software Engineer dataVoice International Inc. 972-390-8808 X144

From: "Masashi Katsumata" notifications@github.com To: "mapsplugin/cordova-plugin-googlemaps" cordova-plugin-googlemaps@noreply.github.com Cc: "kim" kim@datavoiceint.com, "Author" author@noreply.github.com Sent: Wednesday, April 19, 2017 11:33:03 AM Subject: Re: [mapsplugin/cordova-plugin-googlemaps] HTML Info Window Occasionally Shows Raw HTML behind Rendered HTML (#1376)

By the way, if you need to sign a NDA, send me it to my e-mail address.

— You are receiving this because you authored the thread. Reply to this email directly, [ https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1376#issuecomment-295334722 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/AIygBEDYXXFqyfPOkcbl7qaMuXPmTJFRks5rxjc_gaJpZM4Mup-s | mute the thread ] .

wf9a5m75 commented 7 years ago

Thank you for the invitation. I will check out the repo after going back to my home.

KimberleeDArmstrong commented 7 years ago
screen shot 2017-04-20 at 9 38 19 am

I found something today that might help. I can click on a marker when I get the raw html, I also get this console error. I can click on the exact same marker right afterwards and it works perfectly with no console error.

wf9a5m75 commented 7 years ago

Oh, I see. This might be great helpful. Thank you for the information.

wf9a5m75 commented 7 years ago

I noticed that the js error you pointed is not occurred every time when the html infowindow displays raw HTML strings. But at least the issue is occurred many times than I thought. I will keep on work.

KimberleeDArmstrong commented 7 years ago

I am only on iOS currently

Sent from my iPhone

On Apr 21, 2017, at 1:20 AM, Masashi Katsumata notifications@github.com wrote:

I noticed that the js error you pointed is not occurred every time when the html infowindow displays raw HTML strings. But at least the issue is occurred many times than I thought. I will keep on work.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

wf9a5m75 commented 7 years ago

I have some update:


HTML InfoWindow displaying non rendered HTML (issue above)

I figured out 50% of the reason of this issue. But the issue is not reproduced after updating some code. Still inspecting.


InfoWindow gets stuck open and can not be closed. Even map.clear() does not remove it. Have to force quit.

App Crashes when panning and zooming quickly.

Both issues are caused by almost same reason. I updated the plugin code. The commit https://github.com/mapsplugin/cordova-plugin-googlemaps/commit/96dae7f5de778ea0b33f0acbb46debf6a1268f61 does not occur these problems (at least while I tested)


Image overlay get stuck on map and does not remove (I have a code hack in to workaround this issue so not a huge deal)

I could not understand what the problem is.


PolyLines aren't being removed from map on remove call.

The plugin code you installed was old. The problem was already fixed at https://github.com/mapsplugin/cordova-plugin-googlemaps/commit/527d19389d4461bcd636724cbaf906b81a9705b5

wf9a5m75 commented 7 years ago

I committed these updates on the update branch of your repo. Please test it. (And please reinstall the latest code of the multiple_maps branch)

KimberleeDArmstrong commented 7 years ago

Great Thanks! Testing now.

Regards,

Kimberlee Armstrong Software Engineer dataVoice International Inc. 972-390-8808 X144

From: "Masashi Katsumata" notifications@github.com To: "mapsplugin/cordova-plugin-googlemaps" cordova-plugin-googlemaps@noreply.github.com Cc: "kim" kim@datavoiceint.com, "Author" author@noreply.github.com Sent: Sunday, April 23, 2017 8:57:32 PM Subject: Re: [mapsplugin/cordova-plugin-googlemaps] HTML Info Window Occasionally Shows Raw HTML behind Rendered HTML (#1376)

I committed these updates on the update branch of your repo. Please test it. (And please reinstall the latest code of the multiple_maps branch)

— You are receiving this because you authored the thread. Reply to this email directly, [ https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1376#issuecomment-296507488 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/AIygBCvly0dUHAxQMMB4HNsVcE_Y6DFfks5rzAGMgaJpZM4Mup-s | mute the thread ] .

KimberleeDArmstrong commented 7 years ago

I will explain better for the last issue.

I have an image overly that shows the electric lines on the map. That layer is a global variable (gridOverlay). In my code on CAMERA_MOVE_END, I remove that layer and re-add it using gridOverlay.remove(). Sometime the layer is not removed from the map. If I look at the map object I can see the layer still there in the list of layers. I wrote a hack to get around it.

I added this to CAMERA_MOVE_END event listener....

for (var key in googleMap.OVERLAYS) { if (key.indexOf('groundoverlay') != -1) { googleMap.OVERLAYS[key].remove(); } }

Regards,

Kimberlee Armstrong Software Engineer dataVoice International Inc. 972-390-8808 X144

From: "Masashi Katsumata" notifications@github.com To: "mapsplugin/cordova-plugin-googlemaps" cordova-plugin-googlemaps@noreply.github.com Cc: "kim" kim@datavoiceint.com, "Author" author@noreply.github.com Sent: Sunday, April 23, 2017 8:55:41 PM Subject: Re: [mapsplugin/cordova-plugin-googlemaps] HTML Info Window Occasionally Shows Raw HTML behind Rendered HTML (#1376)

I have some update:

HTML InfoWindow displaying non rendered HTML (issue above)

I figured out 50% of the reason of this issue. But the issue is not reproduced after updating some code. Still inspecting.

BQ_BEGIN

InfoWindow gets stuck open and can not be closed. Even map.clear() does not remove it. Have to force quit. BQ_END

BQ_BEGIN

App Crashes when panning and zooming quickly. BQ_END

Both issues are caused by almost same reason. I updated the plugin code. The commit [ https://github.com/mapsplugin/cordova-plugin-googlemaps/commit/96dae7f5de778ea0b33f0acbb46debf6a1268f61 | 96dae7f ] does not occur these problems (at least while I tested)

BQ_BEGIN

Image overlay get stuck on map and does not remove (I have a code hack in to workaround this issue so not a huge deal) BQ_END

I could not understand what the problem is.

BQ_BEGIN

PolyLines aren't being removed from map on remove call. BQ_END

The plugin code you installed was old. The problem was already fixed at [ https://github.com/mapsplugin/cordova-plugin-googlemaps/commit/527d19389d4461bcd636724cbaf906b81a9705b5 | 527d193 ]

— You are receiving this because you authored the thread. Reply to this email directly, [ https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1376#issuecomment-296507317 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/AIygBDvn2Ea9A08u_IzmYHKmi0dRKGeGks5rzAEdgaJpZM4Mup-s | mute the thread ] .

KimberleeDArmstrong commented 7 years ago

Ok. I feel like I am going crazy. I removed and redownloaded the plugin... screen shot 2017-05-02 at 4 08 54 pm I installed the bit bucket changes... screen shot 2017-05-02 at 4 20 41 pm When I built my project it looked like the InfoWindow is gone. I only see HTMLInfoWindow. What did I do wrong? screen shot 2017-05-02 at 4 08 11 pm screen shot 2017-05-02 at 4 09 50 pm

By the way, I can give you up to 4 more weeks to help debug the project and the company will donate handsomely if we can get it stable.

wf9a5m75 commented 7 years ago

Ah, sorry. You tried the plugin code before I announce.

Yes, the InfoWindow class has been renamed to HtmlInfoWindow. And you also need to modify your code a little.

Before:

  var infoWindow = new plugin.google.maps.InfoWindow();

  map.addMarker({
    position: {lat: 0, lng: 0},
    title: [
      'This is <b>Html</b> InfoWindow',
      '<br>',
      '<button onclick="javascript:alert(\'clicked!\');">click here</button>',
    ].join(""),
    infoWindow: infoWindow
  });

After:

  var htmlInfoWindow = new plugin.google.maps.HtmlInfoWindow();

  var html = [
    'This is <b>Html</b> InfoWindow',
    '<button onclick="javascript:alert(\'clicked!\');">click here</button>',
  ].join("");
  htmlInfoWindow.setContent(html);

  map.addMarker({
    position: {lat: 0, lng: 0},
    draggable: true,
    infoWindow: htmlInfoWindow
  });
KimberleeDArmstrong commented 7 years ago

At least I am not going crazy ;-)

wf9a5m75 commented 7 years ago

Sounds good :)

KimberleeDArmstrong commented 7 years ago

Should I still grab the commit code on bit bucket or does the plugin I installed yesterday evening have all that code in it?

KimberleeDArmstrong commented 7 years ago

I don't see the setContent function??

screen shot 2017-05-03 at 9 57 58 am screen shot 2017-05-03 at 9 58 47 am

wf9a5m75 commented 7 years ago

Should be there.

https://github.com/mapsplugin/cordova-plugin-googlemaps/blob/814f019b3e1541d6312d7f38556bd58c8006dddf/www/HtmlInfoWindow.js#L182

wf9a5m75 commented 7 years ago

Ah, I think you installed kind of old commit version. Please reinstall the plugin.

KimberleeDArmstrong commented 7 years ago

I still use #multiplemaps?

Regards,

Kimberlee Armstrong Software Engineer dataVoice International Inc. 972-390-8808 X144

From: "Masashi Katsumata" notifications@github.com To: "mapsplugin" cordova-plugin-googlemaps@noreply.github.com Cc: "kim" kim@datavoiceint.com, "Author" author@noreply.github.com Sent: Wednesday, May 3, 2017 11:15:57 AM Subject: Re: [mapsplugin/cordova-plugin-googlemaps] HTML Info Window Occasionally Shows Raw HTML behind Rendered HTML (#1376)

Ah, I think you installed kind of old commit version. Please reinstall the plugin.

— You are receiving this because you authored the thread. Reply to this email directly, [ https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1376#issuecomment-298960281 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/AIygBI_dYwZf2f0pFA07Y7xuoZ-3373kks5r2Kg9gaJpZM4Mup-s | mute the thread ] .

KimberleeDArmstrong commented 7 years ago

I still use #multiple_maps right?

wf9a5m75 commented 7 years ago

The last commit of the multiple_maps is https://github.com/mapsplugin/cordova-plugin-googlemaps/commit/32f562955275e64f48a7a142f8bb36e6031d4b14

KimberleeDArmstrong commented 7 years ago

screen shot 2017-05-03 at 2 45 13 pm Sorry to be such a pain today. Pointing directly to that commit allowed me to get the right code. But now I am not seeing a showInfoWindow() function. Did something change there?

wf9a5m75 commented 7 years ago

Did something change there?

No, I didn't. The changes only on HtmlInfoWindow.js

https://github.com/mapsplugin/cordova-plugin-googlemaps/blob/multiple_maps/www/Marker.js#L249-L252

wf9a5m75 commented 7 years ago

I'm checking for iOS.

wf9a5m75 commented 7 years ago

Sorry for painful day for you. I found the problem and fixed it. Please reinstall the plugin. I confirmed the HtmlInfoWindow works on iOS.

KimberleeDArmstrong commented 7 years ago

No worries thank you for looking into it. We are all good. I will continue with my testing!

KimberleeDArmstrong commented 7 years ago

It looks like the raw html behind the rendered infoWindow issue is fixed! Yay! I have been testing all day and haven't seen one problem. I am having other new issue with my app. Sometimes the marker isn't clickable for infoWindow, refresh same marker is clickable for infoWindow, refresh same marker doesn't appear, refresh same marker shows up and is clickable for infoWindow. I am still having frequent app crashes also. Do you want me to open another issue and close this one?

wf9a5m75 commented 7 years ago

Sometimes the marker isn't clickable for infoWindow, refresh same marker is clickable for infoWindow, refresh same marker doesn't appear, refresh same marker shows up and is clickable for infoWindow.

Is there any (JS or native) error logs at the time?

I am still having frequent app crashes also.

When? I tested your app 2 weeks ago, but I haven't faced the crash after the updating the plugin code.

Do you want me to open another issue and close this one?

Yes, please.

KimberleeDArmstrong commented 7 years ago

I am not seeing any native nor JS errors and looking at the marker in the map object MARKERS element the markers that are working and aren't working are identical.