123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- 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 : 28;
- this.height = options.height != undefined ? options.height : 28;
- let type = options.type == undefined ? 'single' : options.type;
- this.iconPath = options.iconPath == undefined ? '/img/markerIcon.png' : options.iconPath;
- if (type != 'single') {
- if (options.num == '') {
- // console.log(options.num, 'chechk success');
- }
- if (app.systemInfo.platform == 'ios') {
- this.label = {
- content: options.num + '',
- color: "#000000",
- fontSize: 14,
- borderWidth: 0,
- borderRadius: 0,
- bgColor: "#00FFFF00",
- padding: 0,
- textAlign: 'center',
- anchorY: -25,
- anchorX: options.num >= 10 ? 0 : 0,
- display: "ALWAYS"
- };
- } else {
- this.callout = {
- content: options.num + '',
- color: '#000',
- borderRadius: 3,
- borderWidth: 0,
- bgColor: '#00FFFF00',
- padding: 0,
- display: 'ALWAYS',
- textAlign: 'center',
- anchorY: 55
- }
- }
- }
- this.setCheckStatus(options.isSelect);
- }
- setCheckStatus(isCheck) {
- if (isCheck == undefined)
- return;
- if (isCheck) {
- this.width = 28;
- this.height = 28;
- } else {
- this.width = 28;
- this.height = 28;
- }
- }
- }
|