这是代码...vargeocoder;varmap;functioninitialize(){geocoder=newgoogle.maps.Geocoder();varaddress="newdelhi";geocoder.geocode({'address':address},function(results,status){if(status==google.maps.GeocoderStatus.OK){varlatitude=results[0].geometry.location.lat();varlongitude=results[0].geometry.location
functioninitAutocomplete(){varlat=document.getElementById('lat').value;varlng=document.getElementById('lng').value;console.log(lat);console.log(lng);varmap=newgoogle.maps.Map(document.getElementById('map'),{center:{lat:lat,lng:lng},zoom:13,mapTypeId:'roadmap'});}它给了我以下错误:error:InvalidValueError:
我有一个Activity,在屏幕的一部分上有一个MapView。在这里,我总是将位置居中到给定点。然后我有另一个Activity,整个屏幕上的MapView在哪里,我以用户位置为中心。当我从整个屏幕MapViewActivity返回到部分屏幕上的MapViewActivity时,我再次调用MapView上的setCenter()。但是现在MapView不是以正确的位置为中心,而是以其他地方几米为中心。当我使用animateTo()时,一切都按预期工作。是setCenter()错误还是我应该如何向自己解释这种奇怪的行为? 最佳答案 好