1 Attachment(s)
[RESOLVED] ucGMap.ctl (Implementation of the Google-Static-API by Schmidt) ERROR
I try to use ucGMap.ctl from here:
http://www.vbforums.com/showthread.p...=1#post4641473
... but sometimes runs with error
Code:
"Runtime Error '5': Invalid Procedure Call or Argument"
Code:
Private Function ReadTagContent(sXML As String, Tag As String) As String
Dim Result As String
Result = Mid$(sXML, InStr(sXML, "<" & Tag & ">") + Len(Tag) + 2)
Result = Left$(Result, InStr(Result, "</" & Tag & ">") - 1)
Result = Replace(Replace(Result, vbCr, ""), vbLf, "")
ReadTagContent = Trim$(Result)
End Function
Attachment 157377
Re: ucGMap.ctl (Implementation of the Google-Static-API by Schmidt) ERROR
So, what's the value of the 'Result' variable at that point? That should give you a clue as to what went wrong...
Re: ucGMap.ctl (Implementation of the Google-Static-API by Schmidt) ERROR
Adding "On Error Resume Next" seems to fix this.
Code:
Private Function ReadTagContent(sXML As String, Tag As String) As String
Dim Result As String
On Error Resume Next
Result = Mid$(sXML, InStr(sXML, "<" & Tag & ">") + Len(Tag) + 2)
Result = Left$(Result, InStr(Result, "</" & Tag & ">") - 1)
Result = Replace(Replace(Result, vbCr, ""), vbLf, "")
ReadTagContent = Trim$(Result)
End Function
1 Attachment(s)
Re: ucGMap.ctl (Implementation of the Google-Static-API by Schmidt) ERROR
Quote:
Originally Posted by
DrUnicode
Adding "On Error Resume Next" seems to fix this.
Yes ... but sometimes on top-right appear
Code:
Map error: g.co/staticmaperror
Attachment 157393
This is the string:
Code:
http://maps.googleapis.com/maps/api/staticmap?sensor=false&format=jpg¢er=44.3166468,23.7954246&zoom=18&size=640x640&maptype=roadmap&markers=icon:https://XXXXXX.ro/PinBloc.png%7Ccolor:0x00FF00%7Clabel:B%7C44.316626, 23.795416
Re: ucGMap.ctl (Implementation of the Google-Static-API by Schmidt) ERROR
Strange. It looks like the message requires a key api
Code:
<GeocodeResponse> <status>OVER_QUERY_LIMIT</status> <error_message>You have exceeded your daily request quota for this API. We recommend registering for a key at the Google Developers Console:
I register a new key and added but now not work at all.
Now i try in URL in browser and message is :
Code:
The Google Maps API server rejected your request. This API project is not authorized to use this API. Please ensure this API is activated in the Google Developers Console
But in console every api is enabled...
SOLVED
You need to go to console.developers.google.com -> select your key -> Library -> Maps -> Then enable Google Static Maps API
WARNING:
the sensor parameter is no longer required. Remove sensor=false
Code:
SensorNotRequired Warning
The sensor parameter is no longer required for the Google Maps JavaScript API. It won't prevent the Google Maps JavaScript API from working correctly, but we recommend that you remove the sensor parameter from the script element.
https://developers.google.com/maps/d...error-messages