Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Getting Error Message, from mobile clicks on Google Maps Markers


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 3 - Last Post: Mar 27, 2017 1:04 PM Last Post By: Alexandre Machado
Aaron Padlesky

Posts: 7
Registered: 4/15/17
Getting Error Message, from mobile clicks on Google Maps Markers  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 15, 2017 8:03 AM
Hello this is my first time posting on this forums here so bare with me. I have been using Intraweb v14.1.6 to try and get a Google Maps API tutorial working inside intraweb, It uses a TIWTemplateProcessorHTML to generate html code from a file in the templates folder to the web page. The html code is just google example for it's markers and onclick event for an infowindow to appear when click. The html code is as follows:
 <!DOCTYPE HTML>
 
<html>
  <head>
		<title>Cuts by Us</title>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  </head>
 
  <body>
    <div class="container">
      <div id="googleMap" style="width:100%;height:600px;margin-bottom:60px;"></div>
    </div>
 
    <script>
      // This example displays a marker at the center of Australia.
      // When the user clicks the marker, an info window opens.
      function initMap() {
        var uluru = {lat: -25.363, lng: 131.044};
        var map = new google.maps.Map(document.getElementById('googleMap'), {
          zoom: 4,
          center: uluru
        });
 
        var contentString = '<div id="content">'+
            '<div id="siteNotice">'+
            '</div>'+
            '<h1 id="firstHeading" class="firstHeading">Uluru</h1>'+
            '<div id="bodyContent">'+
            '<p><b>Uluru</b>, also referred to as <b>Ayers Rock</b>.</p>'+
            '</div>'+
            '</div>';
 
        var marker = new google.maps.Marker({
          position: uluru,
          title: 'Uluru (Ayers Rock)'
        });
        marker.setMap(map);
        google.maps.event.addListener(marker, 'click', function() {
          var infowindow = new google.maps.InfoWindow({
            content: contentString
          });
          infowindow.open(map, marker);
        });
      }
    </script>
    <script async defer
    src="https://maps.googleapis.com/maps/api/js?callback=initMap">
    </script>
  </body>
</html>

This works fine on desktop browsers, however if you open up the developer options in say Chrome and enable the touch/mobile feature to simulate a mobile phone browser it will sometimes work the first time but then if you refresh the page you will get an error message like this

Uncaught TypeError: Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'.
at Qt (common.js:118)
at Lt._.k.bc (common.js:199)
at st.bc (common.js:193)
at tt._.k.zm (common.js:194)

and that error message will continue to appear even after I restart the server.

I've created a basic project with nothing else changed minus that IWTemplateprocessor on Unit1.pas to generate the html code. If you could guide me as to what is going wrong here or if there is something I can change to make this work I'm all ears. Currently spent 2 days trying to figure out this problem so far and I'm thinking it is something in the back end of intraweb that is causing this since the google maps api tutorial for this found here https://developers.google.com/maps/documentation/javascript/examples/infowindow-simple works on mobile devices.

Edited by: Aaron Padlesky on Mar 15, 2017 8:03 AM
Aaron Padlesky

Posts: 7
Registered: 4/15/17
Re: Getting Error Message, from mobile clicks on Google Maps Markers  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 21, 2017 8:25 AM   in response to: Aaron Padlesky in response to: Aaron Padlesky
Updating to v 14.1.8 fixed the issue.
Chad Hower

Posts: 613
Registered: 3/2/07
Re: Getting Error Message, from mobile clicks on Google Maps Markers  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 21, 2017 10:27 AM   in response to: Aaron Padlesky in response to: Aaron Padlesky
On 3/21/2017 11:25 AM, Aaron Padlesky wrote:
Updating to v 14.1.8 fixed the issue.

Thanks.
Alexandre Machado

Posts: 1,754
Registered: 8/10/13
Re: Getting Error Message, from mobile clicks on Google Maps Markers  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 27, 2017 1:04 PM   in response to: Aaron Padlesky in response to: Aaron Padlesky
Aaron Padlesky wrote:
Updating to v 14.1.8 fixed the issue.

The interesting thing is: I have an old IW google maps app that has always worked correctly. Only recently g-maps api started to conflict with IW functions (and IW functions haven't been renamed at all. When they have, it is part of IW own namespece which prevents any conflicts).
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02