hyzp_ybqx-Commit136:已经通过修改 flutter_bmfmap_1.0.2,实现加载外部存储中的.png带文本的标识图标
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user