AILabel.js之实例2:绘制图像

AILabel.js之实例2:绘制图像

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script src='AILabel.pkg.min.js'></script>
	<style>
        body {

        }
        #map {
        	width: 500px;
        	height: 400px;
        	border: 1px solid red;
        	position: relative;
        	cursor: pointer;
        }
        #eagle-map,
        #eagle-map2 {
        	position: relative;
            float: left;

        }
        #eagle-control-id-grid {
            border-width: 0 !important;
        }
	</style>
</head>
<body>
    <div id="map"></div>
    <div id="eagle-map"></div>
    <div id="eagle-map2"></div>
	<span>说明:可进行图片平移,滑轮缩放</span>
    <script>
        // 容器对象声明
        let gMap = new AILabel.Map('map', {zoom: 1080, cx: 0, cy: 0, zoomMax: 650 * 10, zoomMin: 650 / 10});

        // 图片层实例\添加
        let gImageLayer = new AILabel.Layer.Image('img', './images/9.jpg', {w: 1080, h: 720}, {
            zIndex: 1,
            grid: {
                rowCount: 4, // 行数
                columnCount: 4, // 列数
                color: '#000' // 边框颜色
            }
        });
        gMap.addLayer(gImageLayer);



		const scaleControl = new AILabel.Control.Scale(
			'scale-control-id',
			{postion: {left: 10, top: 10}}
		);
		gMap.addControl(scaleControl);

		const eagleControl = new AILabel.Control.EagleMap(
			'eagle-control-id',
			{
                container: 'eagle-map', // 自定义缩略图控件展示位置
                // postion: {right: 10, bottom: 10}, // 当存在container时,此参数不需要传
                image: {src: './images/18.jpg', width: 1080, height: 720},
                grid: {
                    rowCount: 3,
                    columnCount: 3,
                    color: 'blue'
                },
                size: {
                    width: 200,
                    height: 150
                }
			}
		);
        gMap.addControl(eagleControl);

        const eagleControl2 = new AILabel.Control.EagleMap(
			'eagle-control-id-grid',
			{
                container: 'eagle-map2', // 自定义缩略图控件展示位置
                image: {src: './images/18.jpg', width: 1080, height: 720},
                type: 'grid',
                grid: {
                    rowCount: 4,
                    columnCount: 4,
                    color: 'black'
                },
                size: {
                    width: 150,
                    height: 150
                }
			}
		);
		gMap.addControl(eagleControl2);

    </script>
</body>
</html>

在这里插入图片描述

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值