Sign in to follow this  
Followers 0
JDGenesis

Google maps locks up in embedded IE

4 posts in this topic

I'm having an issue with using google maps in an embedded IE control.  I'm not sure if it is a IE version (v9 on my PC) or AutoIt issue and hope someone can test this on their end.  Below is a simple test program that embeds an IE control and loads a custom marker.  The program works fine with a default icon, but with a custom marker it fails to show the marker and freezes the map after you zoom in or out.  Does someone mind trying it on their end?  Put "//" in front of the icon object to see it work correctly.

GUICreate("",800, 600)
    $gmap = _IECreateEmbedded()
    $gmap_ctrl = GUICtrlCreateObj($gmap, -1, -1, 800, 600)
    _IENavigate($gmap, "about:blank", 0)

    $html = _
    "<!DOCTYPE html><html><head><style type=""text/css"">" & @CRLF & _
      "html, body { height: 100%; margin: 0; padding: 0; overflow:hidden;}" & @CRLF & _
      "#map { height: 100%; }" & @CRLF & _
    "</style></head><body><div id=""map""></div><script type=""text/javascript"">" & @CRLF & _
    "   var map;" & @CRLF & _
    "   function initMap() {" & @CRLF & _
    "       map = new google.maps.Map(document.getElementById('map'), {" & @CRLF & _
    "           center: {lat: 26.527387,lng: -83.9892645}," & @CRLF & _
    "           zoom: 10" & @CRLF & _
    "       });" & @CRLF & _
    "       var issueIcon = {" & @CRLF & _
    "           path: 'M -45,-110 45,-110 45,-25 -45,-25 Z'," & @CRLF & _
    "           fillColor: 'yellow'," & @CRLF & _
    "           fillOpacity: 1," & @CRLF & _
    "           scale: 1," & @CRLF & _
    "           strokeColor: 'black'," & @CRLF & _
    "           strokeWeight: 1" & @CRLF & _
    "       };" & @CRLF & _
    "       var infowindow = new google.maps.InfoWindow({" & @CRLF & _
    "           content: 'test'" & @CRLF & _
    "       });" & @CRLF & _
    "       var marker = new google.maps.Marker({" & @CRLF & _
    "           position: map.getCenter()," & @CRLF & _
    "           map: map," & @CRLF & _
    "           icon: issueIcon," & @CRLF & _
    "           title: 'test'" & @CRLF & _
    "       });" & @CRLF & _
    "       marker.addListener('click', function() {" & @CRLF & _
    "           infowindow.open(map, marker);" & @CRLF & _
    "       });" & @CRLF & _
    "   }" & @CRLF & _
    "</script><script async defer src=""https://maps.googleapis.com/maps/api/js?callback=initMap""></script></body></html>"

    _IEDocWriteHTML($gmap, $html)
    ;_IEAction ($gmap, "refresh")

    GUISetState(@SW_SHOW)

    While 1
        $iMsg = GUIGetMsg()

        Select
            Case $iMsg = $GUI_EVENT_CLOSE
                ExitLoop
        EndSelect

    WEnd

    GUIDelete()

Thank you.

Share this post


Link to post
Share on other sites



Works just fine for me.

So it's just me.  Thanks.  Which version of IE do you have?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • mjolnirmarkiv
      By mjolnirmarkiv
      Hi!
      Does anyone have any idea why Test() returns 0, while Test2() returns 1?
      #include <IE.au3> MsgBox(0, "", Test() & " " & Test2()) Func Test() Local $oHTML = ObjCreate("HTMLFILE") $oHTML.body.innerHTML = FileRead("Test.html") Return IsObj($oHTML.getElementsByClassName("example")) EndFunc Func Test2() Local $oIE = _IEAttach("", "instance", 1) Return IsObj($oIE.document.getElementsByClassName("example")) EndFunc Sample Test.html I open in IE before testing:
      <!DOCTYPE html> <html> <body> <p class="example"></p> <div class="example"></div> </body> </html> I'm receiving html text in a response to http request, I need to parse it fast and easy, getElementsByClassName would have been ideal. I'm using 3.3.12.0 version.
    • ADIN
      By ADIN
      When at some page i access by  IE.au3 appears javascript alert all my code stops and i cant do nothing. Is there any way to stop executing javascript at this page or any way to force autoit to click "OK" when this alert appears?
       
      _IENavigate($oIE, "www.example.com") _IELoadWait($oIE) ; site is loaded and alert appears Send("{ENTER}") ;i want to close alert, this command is not executed, whole script is freeze ; cant do nothing more here....  
    • ADIN
      By ADIN
      I want use _IEFormGetCollection to get form content which was generated by javascript
      Local $oIE = _IECreate("https://www.example.com/login.html") ;Open the login page Local $oSpans = _IETagNameGetCollection($oIE, "span") For $oSpan In $oSpans if $oSpan.innertext == "Login" Then _IEAction($oSpan, "click") EndIf Next ;click span which ganerate by javascript login form Local $oForm = _IEFormGetCollection($oIE, 0) ;get my form, but that was not on website after loading, appears after click button and this function cant see it Local $oEmail = _IEFormElementGetObjByName($oForm, "email") ; trying to parse form but cant _IEFormElementSetValue($oEmail, "example@gmail.com") ; _IEFormGetCollection dont see generated dynamically elements Is here any way to _IETagNameGetCollection read website content again after i inititate a javascript which generate additional content?
    • dumbledown
      By dumbledown
      Hi,
      I'm new to AutoIt but it looks great.
      I want to get the text from Internet Explorer when hovering the mouse over an image, the statusbargettext function appears to be the way to go.
      When running via a hotkey I return a blank, but the msgbox works. Do you know what I'm doing wrong?
      Thanks
      HotKeySet("!x", "RecordURL") ;wait for ALT-a keystroke While 1 ;loop forever to wait for the keypress Sleep(100) ;no need to kill the CPU WEnd Func RecordURL() #include <MsgBoxConstants.au3> AutoItSetOption("WinTitleMatchMode", 2) Local $sText = StatusbarGetText("Internet Explorer") MsgBox($MB_SYSTEMMODAL, "", "Internet Explorer's status bar says: " & $sText) EndFunc  
       
    • boooooom
      By boooooom
      I'm trying to get the HTML code after executing javascript in IE. Here is my code.
      $url = "http://example.com" $oIE = _IECreate($url) Sleep(3000) ;waiting for executing javascript. But useless. $oFrame = _IEFrameGetCollection($oIE, 0) $sCode &= _IEPropertyGet($oFrame, "innerhtml") & @CRLF Then, I get this error.
      "C:\Program Files (x86)\AutoIt3\Include\IE.au3" (2308) : ==> The requested action with this object has failed.: $oTemp = $oObject.document.body $oTemp = $oObject^ ERROR After executing javascript, when I view source in IE, there are HTML code like below.
      <html> <head> ... </head> <body> ... </body> </html> What should I do?