Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
amap_flutter_map
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
openSourceLibrary
amap_flutter_map
Commits
f0784f7f
提交
f0784f7f
authored
12月 28, 2023
作者:
shixiaochen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1、Android-设置已中心点地图缩放;
上级
06e01335
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
52 行增加
和
29 行删除
+52
-29
AMapOptionsBuilder.java
...rc/main/java/com/amap/flutter/map/AMapOptionsBuilder.java
+9
-1
AMapOptionsSink.java
.../main/java/com/amap/flutter/map/core/AMapOptionsSink.java
+2
-0
MapController.java
...rc/main/java/com/amap/flutter/map/core/MapController.java
+5
-0
build.gradle
example/android/app/build.gradle
+16
-16
AndroidManifest.xml
example/android/app/src/main/AndroidManifest.xml
+1
-0
build.gradle
example/android/build.gradle
+2
-2
gradle-wrapper.properties
example/android/gradle/wrapper/gradle-wrapper.properties
+1
-1
map_all_config.dart
example/lib/pages/map/map_all_config.dart
+16
-9
没有找到文件。
android/src/main/java/com/amap/flutter/map/AMapOptionsBuilder.java
浏览文件 @
f0784f7f
...
@@ -39,6 +39,8 @@ class AMapOptionsBuilder implements AMapOptionsSink {
...
@@ -39,6 +39,8 @@ class AMapOptionsBuilder implements AMapOptionsSink {
private
float
anchorX
=
2.0
F
;
private
float
anchorX
=
2.0
F
;
private
float
anchorY
=
2.0
F
;
private
float
anchorY
=
2.0
F
;
private
boolean
center
=
true
;
private
Object
initialMarkers
;
private
Object
initialMarkers
;
private
Object
initialPolylines
;
private
Object
initialPolylines
;
...
@@ -69,7 +71,8 @@ class AMapOptionsBuilder implements AMapOptionsSink {
...
@@ -69,7 +71,8 @@ class AMapOptionsBuilder implements AMapOptionsSink {
aMapPlatformView
.
getMapController
().
setScreenAnchor
(
anchorX
,
anchorY
);
aMapPlatformView
.
getMapController
().
setScreenAnchor
(
anchorX
,
anchorY
);
}
}
// 设置以中心点缩放
aMapPlatformView
.
getMapController
().
setGestureScaleByMapCenter
(
true
);
aMapPlatformView
.
getMapController
().
setMinZoomLevel
(
minZoomLevel
);
aMapPlatformView
.
getMapController
().
setMinZoomLevel
(
minZoomLevel
);
aMapPlatformView
.
getMapController
().
setMaxZoomLevel
(
maxZoomLevel
);
aMapPlatformView
.
getMapController
().
setMaxZoomLevel
(
maxZoomLevel
);
...
@@ -130,6 +133,11 @@ class AMapOptionsBuilder implements AMapOptionsSink {
...
@@ -130,6 +133,11 @@ class AMapOptionsBuilder implements AMapOptionsSink {
anchorY
=
y
;
anchorY
=
y
;
}
}
@Override
public
void
setGestureScaleByMapCenter
(
boolean
center
)
{
this
.
center
=
center
;
}
@Override
@Override
public
void
setMinZoomLevel
(
float
minZoomLevel
)
{
public
void
setMinZoomLevel
(
float
minZoomLevel
)
{
this
.
minZoomLevel
=
minZoomLevel
;
this
.
minZoomLevel
=
minZoomLevel
;
...
...
android/src/main/java/com/amap/flutter/map/core/AMapOptionsSink.java
浏览文件 @
f0784f7f
...
@@ -24,6 +24,8 @@ public interface AMapOptionsSink {
...
@@ -24,6 +24,8 @@ public interface AMapOptionsSink {
public
void
setScreenAnchor
(
float
x
,
float
y
);
public
void
setScreenAnchor
(
float
x
,
float
y
);
public
void
setGestureScaleByMapCenter
(
boolean
center
);
public
void
setMinZoomLevel
(
float
minZoomLevel
);
public
void
setMinZoomLevel
(
float
minZoomLevel
);
public
void
setMaxZoomLevel
(
float
maxZoomLevel
);
public
void
setMaxZoomLevel
(
float
maxZoomLevel
);
...
...
android/src/main/java/com/amap/flutter/map/core/MapController.java
浏览文件 @
f0784f7f
...
@@ -285,6 +285,11 @@ public class MapController
...
@@ -285,6 +285,11 @@ public class MapController
amap
.
setPointToCenter
(
Float
.
valueOf
(
mapView
.
getWidth
()
*
x
).
intValue
(),
Float
.
valueOf
(
mapView
.
getHeight
()
*
y
).
intValue
());
amap
.
setPointToCenter
(
Float
.
valueOf
(
mapView
.
getWidth
()
*
x
).
intValue
(),
Float
.
valueOf
(
mapView
.
getHeight
()
*
y
).
intValue
());
}
}
@Override
public
void
setGestureScaleByMapCenter
(
boolean
center
)
{
amap
.
getUiSettings
().
setGestureScaleByMapCenter
(
center
);
}
@Override
@Override
public
void
setMinZoomLevel
(
float
minZoomLevel
)
{
public
void
setMinZoomLevel
(
float
minZoomLevel
)
{
amap
.
setMinZoomLevel
(
minZoomLevel
);
amap
.
setMinZoomLevel
(
minZoomLevel
);
...
...
example/android/app/build.gradle
浏览文件 @
f0784f7f
...
@@ -24,12 +24,12 @@ if (flutterVersionName == null) {
...
@@ -24,12 +24,12 @@ if (flutterVersionName == null) {
apply
plugin:
'com.android.application'
apply
plugin:
'com.android.application'
apply
from:
"$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply
from:
"$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def
keystorePropertiesFile
=
rootProject
.
file
(
"app/key.properties"
)
//
def keystorePropertiesFile = rootProject.file("app/key.properties")
def
keystoreProperties
=
new
Properties
()
//
def keystoreProperties = new Properties()
keystoreProperties
.
load
(
new
FileInputStream
(
keystorePropertiesFile
))
//
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
android
{
android
{
compileSdkVersion
3
1
compileSdkVersion
3
3
lintOptions
{
lintOptions
{
disable
'InvalidPackage'
disable
'InvalidPackage'
...
@@ -44,24 +44,24 @@ android {
...
@@ -44,24 +44,24 @@ android {
versionName
flutterVersionName
versionName
flutterVersionName
}
}
signingConfigs
{
signingConfigs
{
release
{
//
release {
//keystore中key的别名
//
//keystore中key的别名
keyAlias
keystoreProperties
[
'keyAlias'
]
//
keyAlias keystoreProperties['keyAlias']
//keystore中key的密码
//
//keystore中key的密码
keyPassword
keystoreProperties
[
'keyPassword'
]
//
keyPassword keystoreProperties['keyPassword']
//keystore的文件路径,可以是绝对路径也可以是相对路径
//
//keystore的文件路径,可以是绝对路径也可以是相对路径
storeFile
file
(
keystoreProperties
[
'storeFile'
])
//
storeFile file(keystoreProperties['storeFile'])
//keystore的密码l
//
//keystore的密码l
storePassword
keystoreProperties
[
'storePassword'
]
//
storePassword keystoreProperties['storePassword']
}
//
}
}
}
buildTypes
{
buildTypes
{
debug
{
debug
{
signingConfig
signingConfigs
.
release
//
signingConfig signingConfigs.release
}
}
release
{
release
{
// flutter build apk
// flutter build apk
signingConfig
signingConfigs
.
release
//
signingConfig signingConfigs.release
}
}
}
}
sourceSets
{
sourceSets
{
...
...
example/android/app/src/main/AndroidManifest.xml
浏览文件 @
f0784f7f
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
android:value=
"6a158bd9bdede0d4276a7ab4fc45ca1b"
/>
android:value=
"6a158bd9bdede0d4276a7ab4fc45ca1b"
/>
<activity
<activity
android:name=
".MainActivity"
android:name=
".MainActivity"
android:exported=
"true"
android:launchMode=
"singleTop"
android:launchMode=
"singleTop"
android:theme=
"@style/LaunchTheme"
android:theme=
"@style/LaunchTheme"
android:configChanges=
"orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:configChanges=
"orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
...
...
example/android/build.gradle
浏览文件 @
f0784f7f
...
@@ -5,7 +5,7 @@ buildscript {
...
@@ -5,7 +5,7 @@ buildscript {
}
}
dependencies
{
dependencies
{
classpath
'com.android.tools.build:gradle:
3.5
.0'
classpath
'com.android.tools.build:gradle:
7.3
.0'
}
}
}
}
...
@@ -24,6 +24,6 @@ subprojects {
...
@@ -24,6 +24,6 @@ subprojects {
project
.
evaluationDependsOn
(
':app'
)
project
.
evaluationDependsOn
(
':app'
)
}
}
task
clean
(
type:
Delete
)
{
task
s
.
register
(
"clean"
,
Delete
)
{
delete
rootProject
.
buildDir
delete
rootProject
.
buildDir
}
}
example/android/gradle/wrapper/gradle-wrapper.properties
浏览文件 @
f0784f7f
...
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
...
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath
=
wrapper/dists
distributionPath
=
wrapper/dists
zipStoreBase
=
GRADLE_USER_HOME
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
zipStorePath
=
wrapper/dists
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-
5.6.2
-all.zip
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-
7.6.1
-all.zip
example/lib/pages/map/map_all_config.dart
浏览文件 @
f0784f7f
import
'dart:typed_data'
;
import
'package:amap_flutter_map/amap_flutter_map.dart'
;
import
'package:amap_flutter_base/amap_flutter_base.dart'
;
import
'package:amap_flutter_map_example/base_page.dart'
;
import
'package:amap_flutter_map_example/base_page.dart'
;
import
'package:amap_flutter_map_example/const_config.dart'
;
import
'package:amap_flutter_map_example/const_config.dart'
;
import
'package:amap_flutter_map_example/widgets/amap_switch_button.dart'
;
import
'package:amap_flutter_map_example/widgets/amap_switch_button.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter/services.dart'
;
import
'package:amap_flutter_map/amap_flutter_map.dart'
;
class
AllMapConfigDemoPage
extends
BasePage
{
class
AllMapConfigDemoPage
extends
BasePage
{
AllMapConfigDemoPage
(
String
title
,
String
subTitle
)
:
super
(
title
,
subTitle
);
AllMapConfigDemoPage
(
String
title
,
String
subTitle
)
:
super
(
title
,
subTitle
);
...
@@ -342,10 +338,21 @@ class _MapUiBodyState extends State<_MapUiBody> {
...
@@ -342,10 +338,21 @@ class _MapUiBodyState extends State<_MapUiBody> {
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
stretch
,
crossAxisAlignment:
CrossAxisAlignment
.
stretch
,
children:
[
children:
[
Container
(
Stack
(
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.6
,
children:
[
width:
MediaQuery
.
of
(
context
).
size
.
width
,
Container
(
child:
map
,
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.6
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
child:
map
,
),
Positioned
(
top:
0
,
bottom:
0
,
left:
0
,
right:
0
,
child:
Icon
(
Icons
.
wrong_location_sharp
,
color:
Colors
.
blue
),
)
],
),
),
Expanded
(
Expanded
(
child:
SingleChildScrollView
(
child:
SingleChildScrollView
(
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论