hyzp_ybqx-Commit136:已经通过修改 flutter_bmfmap_1.0.2,实现加载外部存储中的.png带文本的标识图标

master
WinUser01 4 years ago
parent c4b9c508e0
commit eb03a6085d

Binary file not shown.

@ -446,7 +446,8 @@ class _BasicMapState extends State<BasicMap> {
//color: Colors.white,
child: InkWell(
// child: Icon(Icons.my_location_outlined, color: Colors.black45),
child: Icon(Icons.add, color: g_zoomLevel < g_zoomMax ? Colors.blue : Colors.grey),
child: Icon(Icons.add,
color: g_zoomLevel < g_zoomMax ? Colors.blue : Colors.grey),
onTap: g_zoomLevel < g_zoomMax
? () {
//g_zoomMin-g_zoomMax

@ -10,6 +10,12 @@ int g_zoomLevel_default = 14; //地图默认缩放倍数
int g_zoomLevel = 14; //
int g_zoomMin = 10;
int g_zoomMax = 18;
String g_myIconPathPre = "";
// g_myIconPathPre = /data/user/0/com.example.hyzp_yibin_bmfmap/app_flutter/myIcons
String g_myIconDir = "myIcons";
String g_myIconPre = "myIcon";
///
List<BMFMarker> g_listBMFMarker = [];
Map g_map_BMFMarkerID_dwIndex = {};
@ -42,7 +48,11 @@ Future getListBMFMarker({List listDwinfo}) async {
subtitle: 'test',
// identifier: '${listDwinfo[i]["id"].toString()}${listDwinfo[i]["dwmc"]}',
identifier: '${(i + 1).toString()}${listDwinfo[i]["dwmc"]}',
icon: 'assets/images/location.png',
// icon: 'assets/images/location.png',
// IOS
icon: "$g_myIconPathPre/${g_myIconPre}${i + 1}.png",
// icon: '/data/user/0/com.example.hyzp_yibin_bmfmap/app_flutter/myIcons/myIcon01.png',
/// , annotation viewannotation
/// centerOffsetview使view
@ -62,33 +72,34 @@ Future getListBMFMarker({List listDwinfo}) async {
g_map_BMFMarkerID_dwIndex[marker.getId()] = i;
g_listBMFMarker.add(marker);
g_listBMFText.add(BMFText(
// text: '${listDwinfo[i]["id"].toString()}${listDwinfo[i]["dwmc"]}',
text: '${(i + 1).toString()}${listDwinfo[i]["dwmc"]}',
//- off_latitude, - off_longitude
//zoomLevel = 15
// 使 Provider EventBus
//https://time.geekbang.org/column/article/131890
//,providereventBus
// : Provider event_bus
//
// Flutter Provider
// position: getBMFCoordinate(listDwinfo[i]["dwzb"],
// off_latitude: -0.0002 * g_zoomLevel * _scale,
// off_longitude: -0.00009 * g_zoomLevel * _scale),
position: getBMFCoordinate(listDwinfo[i]["dwzb"]),
//off_latitudeoff_longitude
bgColor: Colors.yellow,
fontColor: Colors.black,
fontSize: 35,
// typeFace:
// BMFTypeFace(familyName: BMFFamilyName.sMonospace, textStype: BMFTextStyle.BOLD_ITALIC),
typeFace: BMFTypeFace(familyName: BMFFamilyName.sMonospace, textStype: BMFTextStyle.BOLD),
alignY: BMFVerticalAlign.ALIGN_TOP,
alignX: BMFHorizontalAlign.ALIGN_LEFT,
rotate: 0.0,
zIndex: 99));
// android
// g_listBMFText.add(BMFText(
// // text: '${listDwinfo[i]["id"].toString()}${listDwinfo[i]["dwmc"]}',
// text: '${(i + 1).toString()}${listDwinfo[i]["dwmc"]}',
// //- off_latitude, - off_longitude
// //zoomLevel = 15
// // 使 Provider EventBus
//
// //https://time.geekbang.org/column/article/131890
// //,providereventBus
// // : Provider event_bus
// //
// // Flutter Provider
// // position: getBMFCoordinate(listDwinfo[i]["dwzb"],
// // off_latitude: -0.0002 * g_zoomLevel * _scale,
// // off_longitude: -0.00009 * g_zoomLevel * _scale),
// position: getBMFCoordinate(listDwinfo[i]["dwzb"]),
// //off_latitudeoff_longitude
// bgColor: Colors.yellow,
// fontColor: Colors.black,
// fontSize: 35,
// // typeFace:
// // BMFTypeFace(familyName: BMFFamilyName.sMonospace, textStype: BMFTextStyle.BOLD_ITALIC),
// typeFace: BMFTypeFace(familyName: BMFFamilyName.sMonospace, textStype: BMFTextStyle.BOLD),
// alignY: BMFVerticalAlign.ALIGN_TOP,
// alignX: BMFHorizontalAlign.ALIGN_LEFT,
// rotate: 0.0,
// zIndex: 99));
}
}

@ -1,6 +1,11 @@
import 'dart:typed_data';
import 'package:flutter/cupertino.dart';
import 'package:hyzp_ybqx/components/commonFun.dart';
import 'package:hyzp_ybqx/components/dioFun.dart';
import 'package:hyzp_ybqx/components/hyxx_data_handle.dart';
import 'package:hyzp_ybqx/pages/Works/DWDT/dwInfo_data.dart';
import 'package:hyzp_ybqx/pages/Works/DWDT/widget_to_image.dart';
import 'package:hyzp_ybqx/services/EventBus.dart';
///
@ -481,10 +486,14 @@ Future startGetStatisDataNew() async {
if (listDwinfoGetList2.isEmpty) {
//便
getThePageList(theHyshlx: 'dwxx').then((value) {
getThePageList(theHyshlx: 'dwxx').then((value) async {
listDwinfoGetList2 = value;
print('listDwinfoGetList2 = \n$listDwinfoGetList2');
dwSum = listDwinfoGetList2.length;
//
await bmfInit();
//
getZptjStatisAlone();
getTodayShtj();
@ -504,6 +513,9 @@ Future startGetStatisDataNew() async {
// }
});
} else {
//
await bmfInit();
if (mapStatisInfo['今日抓拍'] < 0) {
//
getZptjStatisAlone();
@ -680,3 +692,23 @@ Future getAllSumCll(String field, List listStatis) async {
}
//////////////////////////////////////////////////////////////////
//
Future bmfInit() async {
g_myIconPathPre = await createDir(g_myIconDir);
print("g_myIconPathPre = $g_myIconPathPre");
// g_myIconPathPre = /data/user/0/com.example.hyzp_yibin_bmfmap/app_flutter/myIcons
int len = listDwinfoGetList2.length;
for (int i = 0; i < len; i++) {
Widget iconWidget = await getIconWidget("${i + 1}" + listDwinfoGetList2[i]["dwmc"]);
ByteData byteData = await widgetToImage(iconWidget);
await saveImage(g_myIconDir, "${g_myIconPre}${i + 1}.png", byteData);
print("i = $i");
if (i == len - 1) {
// setState(() {});
// runApp(MyApp());
}
}
}
//////////////////////////////////////////////////////////////////

@ -221,40 +221,10 @@ flutter:
# - images/a_dot_ham.jpeg
assets:
- assets/images/
- assets/fun_icons/
- assets/files_icons/
- assets/fun_icons/
- assets/images/
- assets/audio/
- assets/images/背景图.png
- assets/images/形状 811.png
- assets/images/形状 810.png
- assets/images/形状 809.png
- assets/images/图层 5.png
- assets/images/矢量智能对象.png
- assets/images/矢量智能对象(1).png
- assets/images/矩形 1 拷贝 39.png
- assets/images/我的.png
- assets/images/形状 2.png
- assets/images/装饰图片10.png
- assets/images/聚焦.png
- assets/images/盾 密码 安全.png
- assets/images/警察.png
- assets/images/1 (104).png
- assets/images/1 (177).png
- assets/images/LED.png
- assets/images/monitor.png
- assets/images/播放 (1).png
- assets/images/图层 11.png
- assets/images/1 (15).png
- assets/images/1 (84).png
- assets/images/1 (194).png
- assets/images/1 (219).png
- assets/images/个人资料.png
- assets/images/意见反馈.png
- assets/images/版本更新.png
- assets/images/清除缓存.png
- assets/images/关于.png
- assets/images/刷新.png
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
@ -281,3 +251,8 @@ flutter:
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
fonts:
- family: myfont
fonts:
- asset: assets/font/iconfont.ttf

Loading…
Cancel
Save