# Google Map location not correct for the first load

**URL:** <https://forum.xojo.com/t/google-map-location-not-correct-for-the-first-load/37562>\
**Category:** Web\
**Created:** [May 10, 2017, 8:58am UTC](https://forum.xojo.com/t/google-map-location-not-correct-for-the-first-load/37562 "2017-05-10T08:58:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LAM\_YUK\_HONG](https://forum.xojo.com/user_avatar/forum.xojo.com/lam_yuk_hong/32/529_2.png) [@LAM\_YUK\_HONG](https://forum.xojo.com/u/LAM_YUK_HONG)\
**Post date:** [May 10, 2017, 8:58am UTC](https://forum.xojo.com/t/google-map-location-not-correct-for-the-first-load/37562/1 "2017-05-10T08:58:17Z")

</div>

Hi All,

I have a WebMapViewer in a Container (in a WebDialog) that shows the google map of a desired location by:

```auto
    Dim location As New WebMapLocation("Hong Kong " + rs.field("StreetNumber").StringValue + " " + rs.Field("StreetName").StringValue)
    MapViewer1.GoToLocation(location)
    MapViewer1.AddLocation(location)
    MapViewer1.Zoom = 16
    MapViewer1.MapType = 0
```

For the first time showing the map after the web app is loaded, the location has a little bit “offset” to the the correct location ([https://drive.google.com/open?id=0B2DNp\_dIdcJXT1NWN3o4d0hWckk](https://drive.google.com/open?id=0B2DNp_dIdcJXT1NWN3o4d0hWckk))

By closing the WebDialog and enter again, the WebMapViewer shows correct location ([https://drive.google.com/open?id=0B2DNp\_dIdcJXekdrSmdGZjl3SkU](https://drive.google.com/open?id=0B2DNp_dIdcJXekdrSmdGZjl3SkU))

“offset” situation ([https://drive.google.com/open?id=0B2DNp\_dIdcJXcDVXckNCbE9vOVU](https://drive.google.com/open?id=0B2DNp_dIdcJXcDVXckNCbE9vOVU))

This problem only happens the first time the map is displayed, any idea?

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 6:45pm UTC](https://forum.xojo.com/t/google-map-location-not-correct-for-the-first-load/37562/2 "2020-10-29T18:45:39Z")

</div>


