I think the problem is in the MapDisplayPosition function, the second parameter must be a geoPostiion variable, as you can see in the help OR it could be a string with the address, have you tried:
sAddress is string = gnWorkaddress + ", " + gnWorkplace + ", " + "Netherlands"
MapDisplayPosition(MAP_Worklocation, sAddress)
Also, you can't assign and Address
to a ..Position
, you need a geoPosition variable; after centering the map with MapDisplayPosition, you can retrieve the position with:
TmpPos is geoPosition
TmpPos = MapGetPosition(MAP_Worklocation)
And then add the marker:
MyMarker is Marker
MyMarker..Position = TmpPos
MyMarker..ActionClick = ProcMarkerClick
MapAddMarker(MAP_Worklocation, MyMarker)
Try with this, I personally found a different workaround because from and address (stree, zip code, city...) wrote during a registration, I needed the gps code, so I used the Google Maps Apis:
oQuery is httpRequest
// Replace blank spaces with +, for URL.
sTempStreet is string = Replace(MyStreet," ","+")
sTempCity is string = Replace(MyCity," ","+")
oQuery..URL = "https://maps.googleapis.com/maps/api/geocode/json?address="+sTempStreet+",+"+sTempCity+"+"+stTempZIP+"+"+stTempCountry+",+stTempState&key=*<yourapikeyhere>*"
oQuery..Method = httpGet
oResponse is httpResponse
oResponse = HTTPSend(oQuery)
vInfo is Variant
vInfo = JSONToVariant(oResponse..Content)
sGPSLatitude = vInfo.results[1].geometry.location.lat
sGPSLongidute = vInfo.results[1].geometry.location.lng