开发者

Problem with GMaps Api

I'm getting an error after calling set center function from google maps api.

this.Pg is u开发者_开发知识库ndefined
l.rz=function(a){if(this.Nb)return this.Pg.apply(this.Nb,a)}; 

I don't know what is the reason. Maybe someone had noticed similar issue? thx


var lat = document.getElementById("lat").value;
var lng = document.getElementById("lng").value;

event.LatLng = new google.maps.LatLng(lat, lng); 

center = event.LatLng;
     var myOptions = {
     zoom:9,// zoon
     mapTypeId: google.maps.MapTypeId.HYBRID, 
     center: center
                }

lat and lng variables are coming from a field is so tailor your html code.

or..

 var center = new google.maps.LatLng(lat, lng); 
                var myOptions = {
                    zoom:9,// zoon
                    mapTypeId: google.maps.MapTypeId.HYBRID, 
                    center: center

                }

https://developers.google.com/maps/documentation/javascript/reference


Please try to use proper parameter and like

  map.setCenter(new GLatlang(34.555,68.999), 18);

and please close thread after getting solution.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜