[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¢er=" & 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.
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.
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.
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
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?
Re: VB6 + WebBrowser + GoogleMaps: It tries to download the image
Quote:
Originally Posted by
IHappenToBe'
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
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 !!!
Re: [RESOLVED] VB6 + WebBrowser + GoogleMaps: It tries to download the image
Quote:
Originally Posted by
Erkin
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
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
Re: [RESOLVED] VB6 + WebBrowser + GoogleMaps: It tries to download the image
Quote:
Originally Posted by
jmsrickland
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
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.
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
Re: [RESOLVED] VB6 + WebBrowser + GoogleMaps: It tries to download the image
Quote:
Originally Posted by
tmsgln
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?
Re: [RESOLVED] VB6 + WebBrowser + GoogleMaps: It tries to download the image
Quote:
Originally Posted by
jpbro
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
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
Re: VB6 + WebBrowser + GoogleMaps: It tries to download the image
Quote:
Originally Posted by
smileyoufu
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
Re: VB6 + WebBrowser + GoogleMaps: It tries to download the image
Quote:
Originally Posted by
Schmidt
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