微信公衆番号中高徳地図表示ルート

7288 ワード


<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
    <title>title>
    <style>
        body,#mapContainer{
            margin:0;
            height:100%;
            width:100%;
            text-align: center;
            font-size:12px;
        }
        .center{
            position: absolute;
            width: 100%;
            bottom: 24px;
        }
    style>
    <link rel="stylesheet" href="http://cache.amap.com/lbs/static/main.css?v=1.0?v=1.0" />
    //             js
    <script src="http://cache.amap.com/lbs/static/es5.min.js">script>
    <script src="http://webapi.amap.com/maps?v=1.3&key=06fb75f531ce19fd2af711465487d07a">script>
    <script>
        function init() {
            var button = document.getElementById('bt');
            map = new AMap.Map("mapContainer");
            AMap.plugin(["AMap.Driving"], function() {
                var drivingOption = {
                    policy:AMap.DrivingPolicy.LEAST_TIME,
                    map:map
                };
                var driving = new AMap.Driving(drivingOption); //                  
                //             
                driving.search([{keyword:'    ',city:'010'},{keyword:'    ',city:'010'}],function(status,result){
                //driving.search(['    '],['    '],function(status,result){
                //city:       ,      、    、    ,     
                    button.onclick = function(){
                        driving.searchOnAMAP({
                            origin:result.origin,
                            destination:result.destination
                        });
                    } 
                });

            });
        }
    script>
head>
<body onload="init()">
    <div id="mapContainer" >div>
        <div class='center'>
            <div id='bt' class="btmtip">       div>
        div>
    div>
body>
html>