zoukankan      html  css  js  c++  java
  • 谷歌位置搜索 蹩脚结合jquery.ui.gmap

    http://gmaps-samples-v3.googlecode.com/svn/trunk/localsearch/places.html

     var gLocalSearch = new GlocalSearch();
        gLocalSearch.setSearchCompleteCallback(null, OnLocalSearch);
        function OnLocalSearch() {
            if (!gLocalSearch.results) {
                window.alert("未找到,请手工查找");
                return;
            }
            //debugger;
            //console.log(gLocalSearch.results[0]);
            var result = gLocalSearch.results[0];
            var lat =result.lat;//$(item).attr("lat");
            var lng = result.lng;//$(item).attr("lng");
            var latlng = new google.maps.LatLng(lat, lng);
            $('#map_canvas').gmap('addMarker', {
                'position': latlng,
                'bounds': true,
                'draggable': true
            }, function (map, marker) {
                $('#map_canvas').gmap('get', 'map').setOptions({ 'center': latlng ,  'draggable': true});
                setTimeout(function () {
                    $('#map_canvas').gmap('option', 'zoom', 15);
                }, 1000);
            }).click(function () {
            });
        }

    function Search() {
            var text = '';
    
            if ($('#selectcounty').val() != '') {
                text += $("#selectcounty option:selected").text()+' ';
    
            }  
            if ($('#selectcity').val() != '') {
                text += $("#selectcity option:selected").text()+' ';
    
            }
            if ($('#selectprovince').val() != '') {
                text += $("#selectprovince option:selected").text()+' ';
            }
                
            text += $('#detailaddress').val();
                
                
            gLocalSearch.execute(text);
        }
  • 相关阅读:
    出队列操作
    出队列操作
    栈和队列7 数据结构和算法29
    KE上传图片
    asp.net常用快捷键
    基于jquery框架实现以下行的向上、向下和删除
    each的用法积累
    JTemplate使用2
    kindeditor API ,kindeditor使用手册,kindeditor函数,kindeditor使用,超级大收集(转载)
    线上帮助
  • 原文地址:https://www.cnblogs.com/zbw911/p/3065326.html
Copyright © 2011-2022 走看看