Commit 8890c002 by niuxiaolin

修改编辑模式不同类型有不同颜色,section选择时选择项目等

parent 3a884fcd
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<section> <section>
<div *ngIf="debug"> <div *ngIf="debug">
<select [(ngModel)]="type"> <select [(ngModel)]="type" (ngModelChange)="typeChange($event)">
<option value="0">project</option> <option value="0">project</option>
<option value="1">course</option> <option value="1">course</option>
<option value="2">SECTION</option> <option value="2">SECTION</option>
...@@ -12,6 +12,12 @@ ...@@ -12,6 +12,12 @@
<select [(ngModel)]="currentCouseId"> <select [(ngModel)]="currentCouseId">
<option *ngFor="let c of courses" [value]="c.id" >{{c.name}}</option> <option *ngFor="let c of courses" [value]="c.id" >{{c.name}}</option>
</select> </select>
<select [(ngModel)]="currentProjId" (ngModelChange)="proj2Change($event,1)">
<option *ngFor="let c of projects1" [value]="c.id" >{{c.name}}</option>
</select>
<select [(ngModel)]="currentProjId" (ngModelChange)="proj2Change($event,2)">
<option *ngFor="let c of projects2" [value]="c.id" >{{c.name}}</option>
</select>
</div> </div>
<!-- <button (click)="openDialog('custom-modal-1')" >新增项目</button> --> <!-- <button (click)="openDialog('custom-modal-1')" >新增项目</button> -->
<button [ngClass]="{focus:highShow}" (click)="toHighWay()">高速公路</button> <button [ngClass]="{focus:highShow}" (click)="toHighWay()">高速公路</button>
...@@ -77,9 +83,16 @@ ...@@ -77,9 +83,16 @@
</button> </button>
<label></label> <label></label>
<label> </label> <label> </label>
<label></label> <label></label>
</section> </section>
<section>
<button>数据信息
</button>
<label>名字:{{currProj.name}}</label>
<label>里程:{{currProj.mileage}}</label>
<label>投资:{{currProj.capital}}</label>
</section>
</div> </div>
</div> </div>
...@@ -90,7 +103,7 @@ ...@@ -90,7 +103,7 @@
<p>capital: <input type="text" [(ngModel)]="proj.capital" /></p> <p>capital: <input type="text" [(ngModel)]="proj.capital" /></p>
<p>coordinate: <input type="text" [(ngModel)]="proj.coordinate" /></p> <p>coordinate: <input type="text" [(ngModel)]="proj.coordinate" /></p>
<p>course: <input type="text" [(ngModel)]="proj.course" /></p> <p>course: <input type="text" [(ngModel)]="proj.course" /></p>
<p>lineStyle: <input type="text" [(ngModel)]="proj.lineStyle" /></p> <p>lineStyle: <input type="text" [(ngModel)]="proj.lineStyle" /></p>
<p>lineWidth: <input type="text" [(ngModel)]="proj.lineWidth" /></p> <p>lineWidth: <input type="text" [(ngModel)]="proj.lineWidth" /></p>
<p>mileage: <input type="text" [(ngModel)]="proj.mileage" /></p> <p>mileage: <input type="text" [(ngModel)]="proj.mileage" /></p>
...@@ -119,7 +132,7 @@ ...@@ -119,7 +132,7 @@
<jw-modal id="custom-modal-3"> <jw-modal id="custom-modal-3">
<h1>添加section</h1> <h1>添加section</h1>
<p>courses名称: <input type="text" [(ngModel)]="section.name" /></p> <p>section名称: <input type="text" [(ngModel)]="section.name" /></p>
<p>projectId: <input type="text" [(ngModel)]="section.project" /></p> <p>projectId: <input type="text" [(ngModel)]="section.project" /></p>
<p>lineStyle: <input type="text" [(ngModel)]="section.lineStyle" /></p> <p>lineStyle: <input type="text" [(ngModel)]="section.lineStyle" /></p>
<p>lineWidth: <input type="text" [(ngModel)]="section.lineWidth" /></p> <p>lineWidth: <input type="text" [(ngModel)]="section.lineWidth" /></p>
......
/** /**
* @fileoverview 百度地图的鼠标绘制工具,对外开放。 * @fileoverview 百度地图的鼠标绘制工具,对外开放。
* 允许用户在地图上点击完成鼠标绘制的功能。 * 允许用户在地图上点击完成鼠标绘制的功能。
...@@ -1034,6 +1036,10 @@ var BMAP_DRAWING_MARKER = "marker", // 鼠标画点模式 ...@@ -1034,6 +1036,10 @@ var BMAP_DRAWING_MARKER = "marker", // 鼠标画点模式
if(me.controlButton == "right" && (e.button == 1 || e.button==0)){ if(me.controlButton == "right" && (e.button == 1 || e.button==0)){
return ; return ;
} }
// //添加hook处理
// if(me.hook&&!me.hook(e.point)){
// return;
// }
points.push(e.point); points.push(e.point);
drawPoint = points.concat(points[points.length - 1]); drawPoint = points.concat(points[points.length - 1]);
if (points.length == 1) { if (points.length == 1) {
...@@ -1642,3 +1648,35 @@ var BMAP_DRAWING_MARKER = "marker", // 鼠标画点模式 ...@@ -1642,3 +1648,35 @@ var BMAP_DRAWING_MARKER = "marker", // 鼠标画点模式
})(); })();
var styleOptions = {
strokeColor: "red", //边线颜色。
fillColor: "red", //填充颜色。当参数为空时,圆形将没有填充效果。
strokeWeight: 3, //边线的宽度,以像素为单位。
strokeOpacity: 0.8, //边线透明度,取值范围0 - 1。
fillOpacity: 0.6, //填充的透明度,取值范围0 - 1。
strokeStyle: 'solid' //边线的样式,solid或dashed。
}
var mapOptions = {
enableMapClick: true
}
//实例化鼠标绘制工具
var drawingManager = new BMapLib.DrawingManager(map, {
isOpen: false, //是否开启绘制模式
enableDrawingTool: true, //是否显示工具栏
drawingToolOptions: {
// anchor: BMAP_ANCHOR_TOP_RIGHT, //位置
offset: new BMap.Size(5, 5), //偏离值
scale: 0.8 //工具栏缩放比例
},
circleOptions: styleOptions, //圆的样式
polylineOptions: styleOptions, //线的样式
polygonOptions: styleOptions, //多边形的样式
rectangleOptions: styleOptions //矩形的样式
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment