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

    • FrancescoDiMuro
      By FrancescoDiMuro
      Good evening everyone
      Before all, I want to say that I'm doing this script to see how _IE* functions work, and see if my studs can hack a quiz I'm working on.
      I want to clarify that I'm not automating any game, bypassing any CAPTCHAs, or anything that could damage anyone.
      I was trying to autofill a form, based on which question is displayed.
      The question is always stored in here:
      <header> <h1><span class="questionid">1. </span>Here goes the question</h1> </header> And answers are stored in here:
      <ul class="answers"> <li><label><span><input id="answer_0" name="answer[]" type="radio" value="0">Answer 1</span></label></li> <li><label><span><input id="answer_1" name="answer[]" type="radio" value="1">Answer 2</span></label></li> <li><label><span><input id="answer_2" name="answer[]" type="radio" value="2">Anwser 3</span></label></li> <li><label><span><input id="answer_3" name="answer[]" type="radio" value="3">Answer 4</span></label></li> </ul></fieldset></form></div> And, there are 15 questions like this.
      How can automatically fill my form?
      Thanks in advance
      Francesco
    • Dent
      By Dent
      @Blueman @Damein
      Dear all,
      I couldn't find anything that related exactly to what I'm trying to achieve although I did find some examples from the two people I've tagged in which has gotten me so far.
      I understand this topic could be a contentious issue and perhaps that's why there's no threads that I could find that relate directly to it. If the subject is taboo then I'll completely understand it if this thread is deleted.
      I want to write a program that periodically posts the IP address and Geo/GPS location data to me some way e.g. ftp/POST/email - the back-story is below.
      Ok so recently I had a computer stolen from my office, the actual value of the computer is very low as it was 10 years old and just for basic office tasks. Whilst the important files were backed up I never got around to automating this process so I lost a couple of weeks work when it was stolen.
      Anyway, this computer was used mainly by one employee and as I wouldn't be at the office a lot of the time I would use VNC to help when they got stuck with a particular task. As the IP was dynamic I found the dynamic DNS solutions supported by the router not to be very reliable so I wrote a small AutoIt program that called the dynamic DNS update link every 15 minutes, this program was in the Start Menu -> Programs -> Start Up folder and worked fine. This computer was a desktop box with no Wifi so was connected via Ethernet.
      As the accounts on the machine are password protected, whoever ends up with the box is likely to format the HD and put a fresh OS on there so this program is unlikely to run again which is a shame because as it's a desktop box with no Wifi I could use the IP address to give to the Police who could get the users name and address by matching who that IP was assigned to at that time. This is very unlikely to be a coffee shop etc.
      So I'm a lot more security and disaster recovery minded now and have replaced that box with a laptop that the staff member can take home with them each day and it automatically backs up to OneDrive upon log in.
      I've put VNC and the dynamic DNS AutoIt program on there but as this is a laptop with Wifi it's obviously very portable and can be used to get online from more locations.
      What I want to do is create another program that gets the device location as well as the IP and sends it to me every 15 minutes or so. I'd plan to put this program in a Guest account that has no password so if this laptop were ever stolen the next user would actually be able to log in and this program would run. Even better would be for this program to be started as a service so it runs before logging in to an account, just like VNC does. Being a laptop it could be used by a thief or other unauthorised user in a coffee shop etc.
      The solution I have explored so far is have a local .htm file that is opened via AutoIt program which when it has loaded displays the latitude and longitude of the machine, the program then saves this to a file with IP address and date/time stamp and sends it to me somehow (I'll probably implement multiple ways of it notifying me just in case of firewalls). The instance of IE would load minimized and quit after the lat/long is read; as it is such a small page running locally this all happens very quickly so is hard for any user to detect and cancel/intercept.
      My only problem with this implementation is I can't find a way for the page to start the script and obtain the location without user interaction (clicking Allow). I know why this is like this, because it could be used to spy on peoples location so could be open to mis-use.
      So perhaps there is a better way, programmatically within AutoIt using Google Maps API (which I haven't looked into properly yet) to do this where there is no user interaction required?
      There are probably commercial applications to do just this (similar to FindMyiPhone) but I've not investigated the availability of those for Windows and don't see how such a commercial application would be any less open to mis-use so why not create my own little app if possible and avoid the cost.
    • Omnitica
      By Omnitica
      Hello!
      I'm new to the forums! Couldn't find any threads covering this issue. Sorry if I'm wrong.

      I'm having problems changing the text/value of a input box. The particular box doesn't have a name or id, just: class="jq_hotkeys_enabled form-control".
      This class appears multiple times throughout the source, so I don't think It's right to reference that object. 
      See image 1.
      However, I've managed to find a object with the name "ctl00$content$ctrl$ucServiceTime$rpServicetimes$ctl00$edtHiddenResourceHelper" which contains the value of the input box, and the id for the person in the dropdown/combobox left of it. (with "dummy-1" selected).
      See image 2.
      As you can see the value is 3982,4545     ( name , time )
      But when I try to change the value of it by doing:
      #include <IE.au3> Local $oIE = _IEAttach(WinGetHandle("[CLASS:IEFrame]"),"embedded") Local $oForm = _IEFormGetObjByName($oIE, "aspnetForm") Local $oInput = _IEFormElementGetObjByName($oForm, "ctl00$content$ctrl$ucServiceTime$rpServicetimes$ctl00$edtHiddenResourceHelper") _IEFormElementSetValue($oInput, "3982,1337") The box doesn't get its new value. I  can see in the source that it's changed though.
      See image 3.
       
      However, if I do: 
      #include <IE.au3> Local $oIE = _IEAttach(WinGetHandle("[CLASS:IEFrame]"),"embedded") Local $oForm = _IEFormGetObjByName($oIE, "aspnetForm") Local $oInput = _IEFormElementGetObjByName($oForm, "ctl00$content$ctrl$ucServiceTime$rpServicetimes$ctl00$edtHiddenResourceHelper") _IEFormElementSetValue($oInput, "3982,1337") $oIE.document.parentwindow.execScript("theForm.submit()") ; But it needs to reload the page The box gets its new value after the page reloads by the theForm.submit() function. 
      This is a bit unfortunate as I want the changes to happen instantly like when I type in the box with the keyboard... or select in the combobox.
      Maybe someone knows how I can do this? Looking forward to an answer! 
      Thanks in advance.
       
      Note: Unfortunately I can't provide with the real URL as it is constricted to employees in the company I work for, but let me know If I should provide anything else.
       



    • kawliga751
      By kawliga751
      I have a workplace GUI that has a search field function that pulls up customer records to allow changes. I am attempting to 1)LOGIN 2)Enter Search field, enter a number and then {ENTER} 3)change specific field once customer record loads. I have very limited experience in GUI manipulation but I am able to login using the below:
      #include <IE.au3> Const $navOpenInNewTab = 0x0800 Dim $oIE = _IECreate('http://asag.xxxxxxx.com/ASAG/index.htm') Call ("RacksheetSignIn") Func RacksheetSignIn () Local $username = _IEGetObjByName ($oIE,"uname") Local $password = _IEGetObjByName ($oIE,"pword") $oIE.Navigate2('http://asag.xxxxxxx.com/apps/RackSheets/LogInSAG/login.asp',2048) _IEFormElementSetValue ($username, "xxxxxxx") _IEFormElementSetValue ($password, "xxxxxxx") Send('{Enter}') EndFunc However I can't seem to use the _IEGetObjByName or Mouseclick to focus on the search field to allow me to enter my search criteria. When I "inspect element" in the Search field I get the attached:
       
      Any help would be MUCH appreciated
       
       
       

    • TotalAuto
      By TotalAuto
      Hi All
      I am new to AutoIT, its community, and pretty much programming in general. 
      After a bit of online research, I decided to focus on AutoIT as my first programming attempt as it seems quite powerful and amazing once you become advanced at it. I have read some introductory pdfs which where good, including from the guy I think who invented it. I also watched various sketchy youtube videos, checked out the forum etc. I have to admit it's a bit confusing starting off but I reckon if I just keep pushing forward with continual hard work I can only get better.  
      My first AutoIT project has been to open Internet Explorer and automatically log into Twitter to save doing it manually. I plan to run this after windows start up via task scheduler. I am using the #include <IE.au3> UDF but for some reason about 20% of the time I receive the following orange error notifications at the bottom of the editor (pic attached). When it happens the IE browser just doesn't open but the program continues to run which mucks up the script. 
      Does anyone know why this is happening and how it can be fixed? Also is there some other better, less error prone way, to open IE and automatically log in?
      I have tried to use the Get Object NAME and ID commands to insert the username and password (i.e. the xxxxxxxxxx's) but when I right click to use "Inspect element" there is no name or id. It seems to be some sort of java script reference?
      I am using Windows 7 with latest updates and Internet Explorer version 11.
      As this is my first post I hope I am following protocols, and if not, please let me know and I will improve.
      Thanks