123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- $(function(){
- getHt();
- initMap();
- mapActive();
- char1();
- page();
- mapRestList();
- rightChange();
- })
- function getHt(){
- var all_height=$(window).height();
- var div_height=all_height-84;
- $("#car_control").css("height",div_height+"px");
- }
- function initMap(){
- var map = new BMap.Map("map_box");
- map.centerAndZoom(new BMap.Point(116.404, 39.915), 11);
-
- var size1 = new BMap.Size(10, 50);
- map.addControl(new BMap.MapTypeControl({
- offset: size1,
- mapTypes:[
- BMAP_NORMAL_MAP,
- BMAP_HYBRID_MAP,
- ]}));
-
- function addMarker(point){
- var marker = new BMap.Marker(point);
- map.addOverlay(marker);
- }
-
- var bounds = map.getBounds();
- var sw = bounds.getSouthWest();
- var ne = bounds.getNorthEast();
- var lngSpan = Math.abs(sw.lng - ne.lng);
- var latSpan = Math.abs(ne.lat - sw.lat);
- for (var i = 0; i < 25; i ++) {
- var point = new BMap.Point(sw.lng + lngSpan * (Math.random() * 0.7), ne.lat - latSpan * (Math.random() * 0.7));
- addMarker(point);
- };
- map.setCurrentCity("北京");
- map.enableScrollWheelZoom(true);
-
-
-
-
-
- var size = new BMap.Size(10, 50);
- map.addControl(new BMap.CityListControl({
- anchor: BMAP_ANCHOR_TOP_LEFT,
- offset: size,
- }));
- }
- function mapActive(){
- $(".map_top>ul>li").click(function(){
- $(this).addClass("active").siblings().removeClass("active");
- $(this).find("a").addClass("active");
- $(this).find("a").parents("li").siblings().find("a").removeClass("active");
- })
- }
- function char1() {
- var myChart = echarts.init($("#char1")[0]);
- option = {
- tooltip : {
- trigger: 'item',
- formatter: "{a} <br/>{b} : {c} ({d}%)"
- },
- legend: {
- orient : 'vertical',
- x : 'right',
- textStyle : {
- color : '#ffffff',
- },
- data:['客运车','危险品车','网约车','学生校车']
- },
- calculable : false,
- series : [
- {
- name:'车类型',
- type:'pie',
- radius : ['40%', '70%'],
- itemStyle : {
- normal : {
- label : {
- show : false
- },
- labelLine : {
- show : false
- }
- },
- emphasis : {
- label : {
- show : true,
- position : 'center',
- textStyle : {
- fontSize : '20',
- fontWeight : 'bold'
- }
- }
- }
- },
- data:[
- {value:335, name:'客运车'},
- {value:310, name:'危险品车'},
- {value:234, name:'网约车'},
- {value:135, name:'学生校车'}
- ]
- }
- ]
- };
- myChart.setOption(option);
- window.addEventListener('resize', function () {myChart.resize();})
- }
- function page(){
- $("#page").Page({
- totalPages: 9,
- liNums: 1,
- activeClass: 'activP',
- callBack : function(page){
-
- }
- });
- }
- function mapRestList(){
- $(".map_work>ul>li").click(function(){
- $(".map_work>ul").hide();
- $(".map_resList").show();
- })
- }
- function back(){
- $(".map_work>ul").show();
- $(".map_resList").hide();
- }
- function rightChange(){
- $(".map_right_top>ul>li").click(function(){
- var ins=$(this).index();
- $(this).addClass("li_active").siblings().removeClass("li_active");
- $(".map_con .map_con_div").eq(ins).show().siblings().hide();
- })
- }
|