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

    • 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?
    • MattG1991
      By MattG1991
      Hello all, 
      I've written a script that pulls info from some web pages, saves the results to variables, and prints it out to a Word document. I've tried to make this script work with a minimum of user interaction. I've noticed an issue happens when I run the script and I have another window set as active, like SciTE for example. It inserts an "ETX" character. I've done this with Notepad too. It displays an upside down L character. Any particular reason why? Unfortunately, I can't post any code. Basically, it gets a collection of tags, applies a test to find the values I want, then pulls the innerhtml from said tag. Then it assigns the results to a global variable.  Any help would be appreciated. 
    • CT83
      By CT83
      I send Pushbullet Updates (pushbullet.com) of my script using its native API and i have the following code to do the same, but in some cases my internet connection sometimes stops responding and the notification can't be send  using HTTP.send($sPD) methods,in such cases due to the lack of internet connection a runtime error (The requested action with this object has failed) is generated! This creates problems, as the stability of my script is affected. Is there a way to solve this problem?
      Func Send_Pushbullet($spTitle,$sBody,$GFPsh_Tk) Local $sPD = '{"type": "note", "title": "'&$spTitle&'","body": "'&$sBody&'"}' $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("POST", "https://api.pushbullet.com/v2/pushes", False) $oHTTP.setRequestHeader("Authorization", "Bearer " & $GFPsh_Tk) $oHTTP.SetRequestHeader("Content-Type", "application/json") $oHTTP.Send($sPD) $Result = $oHTTP.ResponseText ToolTip2("PushBullet :"&$Result) ToolTip2("PushBullet Sent - "&$spTitle&" : "&$sBody&" "&$GFPsh_Tk) EndFunc  
    • jonson1986
      By jonson1986
      Hello I'm trying to translate few text using below code, I found it working previously couple of months ago but Now these days it's not working at all and I'm getting below errors when I run the script and Array display at the end of text also not able to show any translated text instead of value 0 & 1;
      --> IE.au3 T3.0-2 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (gt-res-data)
      --> IE.au3 T3.0-2 Error from function _IEPropertyGet, $_IESTATUS_InvalidDataType
      Here is code,
      #include <IE.au3> #include <Array.au3> Local $tag="* # * # *" Local $oIE=_IECreate("https://translate.google.com/#auto/es") Local $oForm=_IEFormGetCollection($oIE,0) Local $oQuery=_IEGetObjByName($oForm,"text") _IEFormElementSetValue($oQuery, $tag & @CR & "Hello World" & @CR & "This is a test" & @CR & $tag) _IEFormSubmit($oForm) _IELoadWait($oIE) Local $oText=_IEGetObjById($oIE,"gt-res-data") $lines=StringSplit(_IEPropertyGet($oText,"innerText"),@CRLF,1) _IEQuit($oIE) _ArrayDelete($lines,_ArraySearch($lines,$tag,1,0,0,1,0) & "-" & $lines[0]) _ArrayDelete($lines,"1-" & _ArraySearch($lines,$tag,1,0,0,1,1)) $lines[0]=UBound($lines)-1 _ArrayDisplay($lines)  
    • PunkoHead
      By PunkoHead
      Hi all,
      I am having an issue with a website that I want to automate.
      I have this menu and I want to click on the Custom button.

       
       
      The buttons with "inspect element" are: 
       

       
      The code that I tried is
      $sSearch = "Custom" $oFrame = _IEFrameGetObjByName($oIE, "options") $oDivs = _IETagNameGetCollection($oFrame, "ul") For $oDiv In $oDivs If String(_IEPropertyGet($oDiv, "InnerText")) = $sSearch Then _IEAction($oDiv, "click") ExitLoop EndIf Next I also tried with:
      $sMyString = "Custom" Local $oLinks = _IELinkGetCollection($oIE) For $oLink In $oLinks Local $sLinkText = _IEPropertyGet($oLink, "innerText") If StringInStr($sLinkText, $sMyString) Then _IEAction($oLink, "click") ExitLoop EndIf Next  
      However, these are not working. Any ideas?