Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
R
react-native-amap3d
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
放牛的园子
react-native-amap3d
Commits
1f632d25
Commit
1f632d25
authored
May 26, 2017
by
Qiu Xiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加更多显示控制
parent
4250b9fd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
6 deletions
+39
-6
AMapViewManager.java
android/src/main/java/com/qiuxiang/AMapViewManager.java
+17
-4
index.js
index.js
+22
-2
No files found.
android/src/main/java/com/qiuxiang/AMapViewManager.java
View file @
1f632d25
...
...
@@ -2,6 +2,7 @@ package com.qiuxiang;
import
com.amap.api.maps.AMap
;
import
com.amap.api.maps.CameraUpdateFactory
;
import
com.amap.api.maps.model.MyLocationStyle
;
import
com.facebook.react.common.MapBuilder
;
import
com.facebook.react.uimanager.SimpleViewManager
;
import
com.facebook.react.uimanager.ThemedReactContext
;
...
...
@@ -14,8 +15,7 @@ class AMapViewManager extends SimpleViewManager<AMapView> {
"standard"
,
AMap
.
MAP_TYPE_NORMAL
,
"satellite"
,
AMap
.
MAP_TYPE_SATELLITE
,
"navigation"
,
AMap
.
MAP_TYPE_NAVI
,
"night"
,
AMap
.
MAP_TYPE_NIGHT
,
"bus"
,
AMap
.
MAP_TYPE_BUS
"night"
,
AMap
.
MAP_TYPE_NIGHT
);
@Override
...
...
@@ -30,6 +30,9 @@ class AMapViewManager extends SimpleViewManager<AMapView> {
@ReactProp
(
name
=
"showsUserLocation"
)
public
void
setMyLocationEnabled
(
AMapView
view
,
boolean
enabled
)
{
MyLocationStyle
locationStyle
=
new
MyLocationStyle
();
locationStyle
.
myLocationType
(
MyLocationStyle
.
LOCATION_TYPE_SHOW
);
view
.
map
.
setMyLocationStyle
(
locationStyle
);
view
.
map
.
setMyLocationEnabled
(
enabled
);
}
...
...
@@ -38,6 +41,11 @@ class AMapViewManager extends SimpleViewManager<AMapView> {
view
.
map
.
showIndoorMap
(
show
);
}
@ReactProp
(
name
=
"showsIndoorSwitch"
)
public
void
setIndoorSwitchEnabled
(
AMapView
view
,
boolean
show
)
{
view
.
ui
.
setIndoorSwitchEnabled
(
show
);
}
@ReactProp
(
name
=
"showsBuildings"
)
public
void
showBuildings
(
AMapView
view
,
boolean
show
)
{
view
.
map
.
showBuildings
(
show
);
...
...
@@ -53,12 +61,12 @@ class AMapViewManager extends SimpleViewManager<AMapView> {
view
.
ui
.
setCompassEnabled
(
show
);
}
@ReactProp
(
name
=
"showZoomControls"
)
@ReactProp
(
name
=
"show
s
ZoomControls"
)
public
void
setZoomControlsEnabled
(
AMapView
view
,
boolean
enabled
)
{
view
.
ui
.
setZoomControlsEnabled
(
enabled
);
}
@ReactProp
(
name
=
"showScale"
)
@ReactProp
(
name
=
"show
s
Scale"
)
public
void
setScaleControlsEnabled
(
AMapView
view
,
boolean
enabled
)
{
view
.
ui
.
setScaleControlsEnabled
(
enabled
);
}
...
...
@@ -112,4 +120,9 @@ class AMapViewManager extends SimpleViewManager<AMapView> {
public
void
setRotateGesturesEnabled
(
AMapView
view
,
boolean
enabled
)
{
view
.
ui
.
setRotateGesturesEnabled
(
enabled
);
}
@ReactProp
(
name
=
"tiltEnabled"
)
public
void
setTiltGesturesEnabled
(
AMapView
view
,
boolean
enabled
)
{
view
.
ui
.
setTiltGesturesEnabled
(
enabled
);
}
}
index.js
View file @
1f632d25
import
{
requireNativeComponent
}
from
'react-native
'
import
{
View
}
from
'react-native'
import
{
PropTypes
}
from
'react
'
import
{
requireNativeComponent
,
View
}
from
'react-native'
export
default
requireNativeComponent
(
'AMapView'
,
{
name
:
'AMapView'
,
propTypes
:
{
...
View
.
propTypes
,
showsUserLocation
:
PropTypes
.
bool
,
showsIndoorMap
:
PropTypes
.
bool
,
showsIndoorSwitch
:
PropTypes
.
bool
,
showsBuildings
:
PropTypes
.
bool
,
showsMapText
:
PropTypes
.
bool
,
showsCompass
:
PropTypes
.
bool
,
showsZoomControls
:
PropTypes
.
bool
,
showsScale
:
PropTypes
.
bool
,
showsMyLocationButton
:
PropTypes
.
bool
,
showsTraffic
:
PropTypes
.
bool
,
mapTextZIndex
:
PropTypes
.
number
,
maxZoomLevel
:
PropTypes
.
number
,
minZoomLevel
:
PropTypes
.
number
,
zoomLevel
:
PropTypes
.
number
,
mapType
:
PropTypes
.
string
,
zoomEnabled
:
PropTypes
.
bool
,
scrollEnabled
:
PropTypes
.
bool
,
rotateEnabled
:
PropTypes
.
bool
,
tiltEnabled
:
PropTypes
.
bool
,
},
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment