js map


 <asp:Button ID="Button2" runat="server" onclientclick="return getAreaBoundary();"  onclick="Button2_Click" Text="Button" />
  <input runat="server"  type="hidden" name="HiddenField2" id="HiddenField2" />

 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
 </asp:UpdatePanel>

<div id="container"></div>
 
    </form>
 
</body>
</html>
<script type="text/javascript">


    var $ = function () { return document.getElementById(arguments[0]); };

    if (typeof console == "undefined") {
        window.console = { log: function () { } };
    }

    var map = new BMap.Map("container");

    map.centerAndZoom(new BMap.Point(113.339845, 23.128291), 9);
    var stdMapCtrl = new BMap.NavigationControl({ type: BMAP_NAVIGATION_CONTROL_SMALL })
    map.addControl(stdMapCtrl);
    map.enableScrollWheelZoom();
    map.enableContinuousZoom();

    function getBoundary(name, color) {

            $('HiddenField2').value = rs.boundaries[0].toString();

            form1.submit();


        });
    }


    function getAreaBoundary() {
        getBoundary($('Text1').value, "yellow")
        return true;

    };
 
</script>

 

你可能感兴趣的:(js map)