javascript - gmappanel 移动到标记坐标 - EXTJS 4

标签 javascript google-maps extjs extjs4

 function addDoctorLocation(options) 
    {
        var gm = Ext.getCmp('mygooglemap');
        var mpoint = new google.maps.LatLng(options.lat,options.lng);
        var marker = gm.addMarker(mpoint,options.marker,false,false, options.listeners);
   // move the map to the mark and adjust the zoom level at here
    }

        tree.on('checkchange', function(node){
            var data = node.data;

            if (data.checked == true){

            lati = 5.391788482666016; 
            longi = 100.29693603515625; 

            var options = {
            lat:lati,
            lng:longi,
            marker: {title:"Hello World!"},
            listeners: {
                         click: function(e){

                                             }
                        }     
            }     
            addDoctorLocation(options);  
            }       
        })

问题

如何将 map 移动到标记处并调整缩放级别?

最佳答案

gm.setCenter(mpoint);
gm.setZoom(8);

请参阅此处 google.maps.Map 类的方法部分:https://developers.google.com/maps/documentation/javascript/reference?hl=en#Map

关于javascript - gmappanel 移动到标记坐标 - EXTJS 4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15100087/

相关文章:

javascript - 谷歌API : Infowindow Content Issue

extjs动态添加参数到商店的基本参数

javascript - 如何在 ExtJS MVC 中将 FiltersFeature 应用到网格

javascript - 如何将固定位置的摘要行添加到无限滚动的网格中

javascript - ServiceNow 中的日期比较

javascript - 使用 d3plus.js 动态更改网络图表

javascript - 使用 Google Maps API 仅自动完成城市名称列表

Android:MapView 仅显示灰色网格,错误为 "Couldn' t get connection factory client”

javascript - jquery/ajax 的意外结果

带有正则表达式的 Javascript 不可操作的 Switch Case