ZjMarker.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. const app = getApp();
  2. export class zjMarker {
  3. constructor(longitude, latitude, id, options = {}) {
  4. // console.log(options)
  5. this.longitude = longitude;
  6. this.latitude = latitude;
  7. this.id = id;
  8. this.width = options.width ? options.width : '48';
  9. this.height = options.height != undefined ? options.height : '48';
  10. let type = options.type == undefined ? 'single' : options.type;
  11. this.iconPath = options.iconPath == undefined ? '' : options.iconPath;
  12. if (type != 'single') {
  13. this.label = {
  14. 'content': options.num + '',
  15. 'color': "#FF0000",
  16. 'borderRadius': 4,
  17. 'bgColor': '#fff',
  18. 'padding': 5,
  19. 'borderWidth': 5,
  20. 'borderColor': '#FF0000'
  21. };
  22. this.anchor = {
  23. x: 5,
  24. y: 1
  25. }
  26. }
  27. this.setCheckStatus(options.isSelect);
  28. }
  29. setCheckStatus(isCheck) {
  30. if (isCheck == undefined)
  31. return;
  32. if (isCheck) {
  33. this.width = '48';
  34. this.height = '48';
  35. } else {
  36. this.width = '48';
  37. this.height = '48';
  38. }
  39. }
  40. }
  41. module.exports = {
  42. zjMarker: zjMarker,
  43. }