soso地图API

根据地址获取经纬度:
城市+地址
http://api.map.qq.com/geoc/?addr="+city+","+address+"&output=jsonp&fr=webapi&cb=soso.maps.ObjectLoader.cbgw31xe4y&t=1323668296402

只有地址
http://api.map.qq.com/geoc/?addr="+address+"&output=jsonp&fr=webapi&cb=soso.maps.ObjectLoader.cbgw31xe4y&t=1323668296402

根据经纬度获取地图
http://st.map.soso.com/api?size=160*200&center=${y},${x}&zoom="+zoom+"&markers=${y},${x},S

放大、缩小、上移、下移、左移、右移js
 <script>
        var zoom = 13;
        var x=${x};
        var y=${y};

        function mapZoom() {
            if (zoom >= 16) {
                return;
            }
            zoom = zoom + 1;
            var ditu = document.getElementById("ditu");
            ditu.src = "http://st.map.soso.com/api?size=160*200&center=${y},${x}&zoom="+zoom+"&markers=${y},${x},S";
            ditu.reload();
        }

        function mapNarrow() {
            if (zoom <= 9) {
                return;
            }
            zoom = zoom - 1;
            var ditu = document.getElementById("ditu");
            ditu.src = "http://st.map.soso.com/api?size=160*200&center=${y},${x}&zoom="+zoom+"&markers=${y},${x},S";
            ditu.reload();
        }

        function mapleft() {
            y = y - 0.004;
            var ditu = document.getElementById("ditu");
            ditu.src = "http://st.map.soso.com/api?size=160*200&center="+y+","+x+"&zoom="+zoom+"&markers=${y},${x},S";
            ditu.reload();
        }

        function mapright() {
            y = y + 0.004;
            var ditu = document.getElementById("ditu");
            ditu.src = "http://st.map.soso.com/api?size=160*200&center="+y+","+x+"&zoom="+zoom+"&markers=${y},${x},S";
            ditu.reload();
        }

        function mapOn() {
            x = x + 0.004;
            var ditu = document.getElementById("ditu");
            ditu.src = "http://st.map.soso.com/api?size=160*200&center="+y+","+x+"&zoom="+zoom+"&markers=${y},${x},S";
            ditu.reload();
        }

        function mapDown() {
            x = x - 0.004;
            var ditu = document.getElementById("ditu");
            ditu.src = "http://st.map.soso.com/api?size=160*200&center="+y+","+x+"&zoom="+zoom+"&markers=${y},${x},S";
            ditu.reload();
        }
    </script>


posted on 2012-09-24 16:47 Mr.lu 阅读(488) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航:
 
<2012年9月>
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

导航

统计

常用链接

留言簿(2)

随笔档案

文章档案

搜索

最新评论

阅读排行榜

评论排行榜