百度地图
实例
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>百度地图</title>
<style>
#map{
width: 1400px;
height: 600px;
background-color: yellow;
margin: 50px auto;
}
</style>
</head>
<body>
<div id="map"></div>
<script src="http://api.map.baidu.com/api?v=3.0&ak=ycw94KA2s8FGXC0elMxYyPGfZt9rdCN7"></script>
<script>
var map = new BMap.Map("map");
var Point = new BMap.Point(109.05357923015082,34.22708029700443);
map.centerAndZoom('西安', 11);
map.enableScrollWheelZoom(true); //开启鼠标滚轮缩放
// var top_left_control = new BMap.ScaleControl({anchor: BMAP_ANCHOR_TOP_LEFT});// 左上角,添加比例尺
var top_left_navigation = new BMap.NavigationControl(); //左上角,添加默认缩放平移控件
// map.addControl(top_left_control);
map.addControl(top_left_navigation);
//添加标注
var marker = new BMap.Marker(Point);
map.addOverlay(marker);
marker.setAnimation(BMAP_ANIMATION_BOUNCE);
// 添加信息窗口
var infoWindow = new BMap.InfoWindow('这是我美丽的家');
marker.addEventListener('click',function () {
map.openInfoWindow(infoWindow,Point);
map.panTo(Point);
});
// 109.05357923015082 34.22708029700443
//右键点击地图显示经纬度坐标
// map.addEventListener('rightclick',function (e) {
// console.log(
// e.point.lng,
// e.point.lat
// )
// })
</script>
</body>
</html>
在线动态图表应用
highcharts
Echarts
图表实例1
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>图表</title>
<style>
#charts{
width: 1000px;
height: 500px;echarts
}
</style>
</head>
<body>
<div id="charts"></div>
<script src="../practise14/效果/echarts/echarts.js"></script>
<script>
var myChart = echarts.init(document.getElementById('charts'));
// 指定图表的配置项和数据
var option = {
//标题
title: {
text: 'ECharts 入门示例'
},
//
tooltip: {},
//图例
legend: {
data:['销量']
},
//水平x轴
xAxis: {
data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]
},
//竖直y轴
yAxis: {},
//数据部分
series: [{
name: '销量',
//显示类型:柱状
type: 'bar',
//数据值
data: [5, 20, 36, 10, 10, 20]
}]
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
</script>
</body>
</html>
图表实例2
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>图表2</title>
</head>
<body>
<div id="container" style="width: 600px;height:400px;"></div>
<script src="http://cdn.highcharts.com.cn/highcharts/highcharts.js"></script>
<script>
// 图表配置
var options = {
chart: {
type: 'bar' //指定图表的类型,默认是折线图(line)
},
credits:{
enabled:true,
text:'zhang'
},
title: {
text: '我的第一个图表' // 标题
},
xAxis: {
categories: ['苹果', '香蕉', '橙子'] // x 轴分类
},
yAxis: {
title: {
text: '吃水果个数' // y 轴标题
}
},
series: [{ // 数据列
name: '小明', // 数据列名
data: [1, 0, 4] // 数据
}, {
name: '小红',
data: [5, 7, 3]
}]
};
// 图表初始化函数
var chart = Highcharts.chart('container', options);
</script>
</body>
</html>
在线Html编辑器
常见的两种
UEditor
KindEditor
KindEditor详解
案列
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>html在线编辑器</title>
</head>
<body>
<form>
<div>标题:<input type="text" name="title"></div>
<div>内容:<textarea id="content" name="content"></textarea></div>
<div><button type="submit">提交</button></div>
<button id="btn">取得html</button>
</form>
<!--加载编译器的主文件-->
<script charset="utf-8" src="kindeditor-master/kindeditor-all-min.js"></script>
<!--考虑到兼容性,加载官方的中文语言库-->
<script charset="utf-8" src="kindeditor-master/lang/zh-CN.js"></script>
<script>
// 类似于jquery的文档就绪
var editor;
KindEditor.ready(function(K) {
editor = K.create('#content',{
// 自定义功能
// width:'700px',
// items:['cut','copy','paste','|','justifyleft','justifycenter','justifyright']
});
});
document.getElementById('btn').onclick = function () {
alert(
editor.html()
)
}
</script>
</body>
</html>