Results 1 to 17 of 17

Thread: [RESOLVED] VB6 + WebBrowser + GoogleMaps: It tries to download the image

  1. #1

    Thread Starter
    Member
    Join Date
    May 2012
    Location
    La Plata, Buenos Aires, Argentina
    Posts
    52

    Resolved [RESOLVED] VB6 + WebBrowser + GoogleMaps: It tries to download the image

    In most of computers (mine included), a WebBrowser where I execute:
    Code:
    WebBrowser1.Navigate "http://maps.googleapis.com/maps/api/staticmap?&size=125x125&center=" & AdressAndSomeOtherParameters
    shows the map correctly.
    BUT, in a few other PC, it tries to download de image (staticmaps.jpg) instead of showing it.
    I have not a screenshot because it doesn't happen to me, just to some clients.
    In one ocasion, it was solved changing the default browser from IE to Google Chrome, but in other case I couldn't to that. Besides, it's not correct to go changing client's browser preferences.

    Any idea why?
    Thanks in advance.

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: VB6 + WebBrowser + GoogleMaps: It tries to download the image

    I think it has something to do with in the internet setting on the target computer.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  3. #3
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: VB6 + WebBrowser + GoogleMaps: It tries to download the image

    I'm sure its the IE/WebBrowser Emulator key in the registry that has to be changed to a different (possibly higher) version.

  4. #4
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: VB6 + WebBrowser + GoogleMaps: It tries to download the image

    There's also the possibility, to avoid the IE-Control entirely (in case it is only the Google-Maps-Static-API the Webbrowser-Component is currently addressing).

    Below is an implementation, which doesn't use any external Lib or Component - just the plain AsyncDownload-functionality of the VB-UserControl
    (which also supports the hand-out of downloaded WebImage-resources as a VB-StdPicture).

    http://www.vbRichClient.com/Download...StaticDemo.zip

    Olaf

  5. #5

    Thread Starter
    Member
    Join Date
    May 2012
    Location
    La Plata, Buenos Aires, Argentina
    Posts
    52

    Re: VB6 + WebBrowser + GoogleMaps: It tries to download the image

    Wow, Olaf... I'm speechless! Your control is so simple and powerful!
    I've been trying to use dinamic maps with VB6 for the last whole year and I just couldn't make it work, and I've found A LOT of people who told me it was impossible.

    Your control uses Static maps but with the functionallity of dinamics... And I loved the fact that the mousewheel is simply achieved by setting the focus to a combobox. It doesn't use webbrowser, and I think it gets rid of the clicking sound of IE, you can add markers... CONGRATULATIONS, really!

    The only thing I'm going to change to it is the direction of mousewheel (it's reversed, wheel down usually zooms out and wheel up usually zooms in), and maybe a busy mouseicon while refreshing.

    Thank you to NightWalker and Max187Boucher too, for helping me with the actual problem I was having.
    Olaf, May I add this control to my software, giving you credit in the "About" screen for it?

  6. #6
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: VB6 + WebBrowser + GoogleMaps: It tries to download the image

    Quote Originally Posted by IHappenToBe' View Post
    May I add this control to my software, giving you credit in the "About" screen for it?
    Sure - when there's no explicit license-clause in the header of Source-Modules, then they are
    usually free to use in any way one chooses - at least that's what I consider common practise
    in the community (and in forums or newsgroups) so far ...
    (the only "rule" in such cases perhaps, that you keep the info who has originally written it,
    to be able to provide it when you repost snippets or demos into public areas again).

    No need for crediting me in "About" - but if you feel better when you do -
    then by all means go ahead - but in bold-letters then, OK?

    Olaf
    Last edited by Schmidt; Mar 26th, 2014 at 11:04 AM.

  7. #7
    New Member
    Join Date
    May 2015
    Posts
    1

    Re: [RESOLVED] VB6 + WebBrowser + GoogleMaps: It tries to download the image

    Dear Olaf , I got acquainted with your work , and she was very helpful in educational purposes . I was wondering how to use your ocx insert a marker in their LatLon without DblClickMouse. Many thanks for your example !!!

  8. #8
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: [RESOLVED] VB6 + WebBrowser + GoogleMaps: It tries to download the image

    Quote Originally Posted by Erkin View Post
    Dear Olaf , I got acquainted with your work , and she was very helpful in educational purposes . I was wondering how to use your ocx insert a marker in their LatLon without DblClickMouse. Many thanks for your example !!!
    A small enhancement for that was described in this thread here:
    http://www.vbforums.com/showthread.p...lem!&p=4875325

    The enhancement then capable to draw a Poly-Line between "externally given Lat/Lon Coord-points".

    Instead of Drawing the Poly-Line you could simply adapt the Drawings to place
    your own "Marker-Icons" on top of the current Map-Image (at the Lat/Lon-Coords given)...

    Olaf

  9. #9
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: [RESOLVED] VB6 + WebBrowser + GoogleMaps: It tries to download the image

    Oops!

    It doesn't work anymore. Everything was alright for awhile then nothing. The map disappeared and nothing from that time on. I closed the project and restarted it but nothing happens - no map just a empty Form where the map should be. Maybe it has to do with the AsyncDownload. I'm not disconnected from the Net so I don't think it's me


    EDIT:
    Ok, here it is 2 hours later and I restarted the project and it was OK. I played around with it for awhile and kaboom it went blank again
    Last edited by jmsrickland; May 31st, 2015 at 08:20 PM.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  10. #10
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: [RESOLVED] VB6 + WebBrowser + GoogleMaps: It tries to download the image

    Quote Originally Posted by jmsrickland View Post
    Oops!

    It doesn't work anymore. Everything was alright for awhile then nothing. The map disappeared and nothing from that time on. I closed the project and restarted it but nothing happens - no map just a empty Form where the map should be. Maybe it has to do with the AsyncDownload. I'm not disconnected from the Net so I don't think it's me


    EDIT:
    Ok, here it is 2 hours later and I restarted the project and it was OK. I played around with it for awhile and kaboom it went blank again
    Did you read, what the current limits are for Googles "Static Maps API" (for the "anonymous" user)?
    IIRC, they have increased the amount of available "requests per day" to a decent number now,
    but there could be additional restrictions with "requests per hour" or "requests per minute".

    Olaf

  11. #11
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: [RESOLVED] VB6 + WebBrowser + GoogleMaps: It tries to download the image

    Yeah, I kind of thought it might be Google putting the clamps on me although I didn't know about any "request per day" it just seemed logical. I was tinkering around with your code trying to make the map move as the mouse moves this way and that way and while I did get it to work it would jam up after so many moves. The last time this happened I had to wait several hours before I could get more maps.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  12. #12
    New Member
    Join Date
    Jun 2021
    Posts
    2

    Re: [RESOLVED] VB6 + WebBrowser + GoogleMaps: It tries to download the image

    I know this post is very old, but I would like to take advantage of the tool they designed, only that the link is no longer available, there is someone who can share it with me and tell me if it is still functional, it would be of great help, greetings

  13. #13
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,412

    Re: [RESOLVED] VB6 + WebBrowser + GoogleMaps: It tries to download the image

    Quote Originally Posted by tmsgln View Post
    I know this post is very old, but I would like to take advantage of the tool they designed, only that the link is no longer available
    The link still works for me? What error code are you seeing?

  14. #14
    New Member
    Join Date
    Jun 2021
    Posts
    2

    Re: [RESOLVED] VB6 + WebBrowser + GoogleMaps: It tries to download the image

    Quote Originally Posted by jpbro View Post
    The link still works for me? What error code are you seeing?
    the download link is not active or shows it blank, the example project is no longer available, thank you for your attention

    http://www.vbrichclient.com/Download...StaticDemo.zip

  15. #15
    Lively Member
    Join Date
    Oct 2014
    Posts
    93

    Re: VB6 + WebBrowser + GoogleMaps: It tries to download the image

    Olaf:
    Hello The link has expired and cannot be downloaded

    http://www.vbrichclient.com/Download...StaticDemo.zip

  16. #16
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: VB6 + WebBrowser + GoogleMaps: It tries to download the image

    Quote Originally Posted by smileyoufu View Post
    Olaf:
    Hello The link has expired and cannot be downloaded

    http://www.vbrichclient.com/Download...StaticDemo.zip
    Still works for me here...
    Are you trying to reach this download-URL from China perhaps?
    Then say thank you to your "big firewall"...

    (which probably detects some Strings which match "Google" inside the zip-content,
    or takes offense with the "GMap", or "GMapStatic" string contained in the URL).

    Besides, the times where everyone was able to make 2000 free requests per day against this StaticMap-API are over.
    Now you have to get a developer-Key - and have to pay for its usage...

    Edit: You might want to try, to copy the Link-URL (as Text) into a new Browser-Tab first -
    ... and then replace the protocol-prefix: http:// with https://


    Olaf
    Last edited by Schmidt; Dec 24th, 2021 at 07:10 AM.

  17. #17
    Lively Member
    Join Date
    Oct 2014
    Posts
    93

    Re: VB6 + WebBrowser + GoogleMaps: It tries to download the image

    Quote Originally Posted by Schmidt View Post
    Still works for me here...
    Are you trying to reach this download-URL from China perhaps?
    Then say thank you to your "big firewall"...

    (which probably detects some Strings which match "Google" inside the zip-content,
    or takes offense with the "GMap", or "GMapStatic" string contained in the URL).

    Besides, the times where everyone was able to make 2000 free requests per day against this StaticMap-API are over.
    Now you have to get a developer-Key - and have to pay for its usage...

    Edit: You might want to try, to copy the Link-URL (as Text) into a new Browser-Tab first -
    ... and then replace the protocol-prefix: http:// with https://


    Olaf
    Thank you so much!
    https://www.vbrichclient.com/Downloa...StaticDemo.zip OK,file can be downloaded normally

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width