12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- const app = getApp();
- export class zjMarker {
- constructor(longitude, latitude, id, options = {}) {
- // console.log(options)
- this.longitude = longitude;
- this.latitude = latitude;
- this.id = id;
- this.width = options.width ? options.width : '48';
- this.height = options.height != undefined ? options.height : '48';
- let type = options.type == undefined ? 'single' : options.type;
- this.iconPath = options.iconPath == undefined ? '' : options.iconPath;
- if (type != 'single') {
- this.label = {
- 'content': options.num + '',
- 'color': "#FF0000",
- 'borderRadius': 4,
- 'bgColor': '#fff',
- 'padding': 5,
- 'borderWidth': 5,
- 'borderColor': '#FF0000'
- };
- this.anchor = {
- x: 5,
- y: 1
- }
- }
- this.setCheckStatus(options.isSelect);
- }
- setCheckStatus(isCheck) {
- if (isCheck == undefined)
- return;
- if (isCheck) {
- this.width = '48';
- this.height = '48';
- } else {
- this.width = '48';
- this.height = '48';
- }
- }
- }
- module.exports = {
- zjMarker: zjMarker,
- }
|