How to get the Google Map based on Latitude on Longitude?

前端 未结 5 2016
耶瑟儿~
耶瑟儿~ 2021-01-30 13:08

I want to display Google map in my web page based on longitude and latitude. First user want to enter longitude and latitude in two text box\'s. Then click submit button I have

5条回答
  •  爱一瞬间的悲伤
    2021-01-30 13:52

    Create a URI like this one:

    https://maps.google.com/?q=[lat],[long]

    For example:

    https://maps.google.com/?q=-37.866963,144.980615

    or, if you are using the javascript API

    map.setCenter(new GLatLng(0,0))
    

    This, and other helpful info comes from here:

    https://developers.google.com/maps/documentation/javascript/reference/?csw=1#Map

提交回复
热议问题