JS格式化

HTML

<!Doctype html>
http://www.w3.org/1999/xhtml>
<head>                  
    <meta http-equiv=Content-Type content="text/html;charset=utf-8">
    <meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1">
    <meta content=always name=referrer>
    <script type="text/javascript" src="ol3/ol.js" charset="utf-8"></script>
    https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js">>>
</head>
<body>
    <div id="Map" style="width: 80%;margin:30px auto;"></div>
</body>
<script type="text/javascript" src="map.js" charset="utf-8"></script>
<script>
    MapGis.init($('#Map'));
</script>
</html>

JS

/**
*Created by Zhangyx on 2015/10/15.
* Modified by pxt  on 2016/06/29.
*/
;(function($,ol){
    var MapGis = function (mapgis){ 

    };

    MapGis.prototype = {

    }

    MapGis.init = function (mapgis){
            mapgis.each(function(index,item){
                new MapGis($(this));
            })  ;
    };

    window["MapGis"] = MapGis;

})(jQuery,ol);
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章