map_info.dart 825 B

12345678910111213141516171819202122232425262728293031
  1. import 'package:trackoffical_app/model.dart';
  2. import 'package:trackoffical_app/pb.dart' as pb;
  3. class MapInfo{
  4. int mapId = 0;
  5. String name = ''; // 地图名称
  6. int mapScaleNumber = 0; // 比例尺,例:1:1500 为 1500
  7. String description = ''; // 地图一句话简介
  8. double distanceKm = 0; // 距离
  9. MNetImage image = MNetImage(); // 预览图片
  10. MPosition position = MPosition();
  11. bool isOpen = true;
  12. bool needPin = false;
  13. }
  14. extension ExtMapSimple on pb.ToMapSimpleV2{
  15. MapInfo toModel(){
  16. return MapInfo()
  17. ..mapId = mapId
  18. ..name = name
  19. ..mapScaleNumber = mapScaleNumber
  20. ..description = description
  21. ..distanceKm = distance/1000
  22. ..image = image.toModel()
  23. // ..position=position.toModel()
  24. // ..isOpen=isOpen
  25. // ..needPin=isPinJoin
  26. ;
  27. }
  28. }