-
Notifications
You must be signed in to change notification settings - Fork 10
Camera
shashank1501 edited this page Mar 23, 2021
·
2 revisions
Welcome to the mapmyindia-map-react-native-beta wiki!
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
| animationDuration | number |
2000 |
false |
The duration a camera update takes (in ms) |
| animationMode | enum |
'easeTo' |
false |
The animationstyle when the camara updates. One of; flyTo, easeTo, moveTo
|
| defaultSettings | shape |
none |
false |
FIX ME NO DESCRIPTION |
| heading | number |
none |
false |
Heading on map |
| pitch | number |
none |
false |
Pitch on map |
| bounds | shape |
none |
false |
FIX ME NO DESCRIPTION |
| ne | array |
none |
true |
northEastCoordinates - North east coordinate of bound |
| sw | array |
none |
true |
southWestCoordinates - North east coordinate of bound |
| paddingLeft | number |
none |
false |
Left camera padding for bounds |
| paddingRight | number |
none |
false |
Right camera padding for bounds |
| paddingTop | number |
none |
false |
Top camera padding for bounds |
| paddingBottom | number |
none |
false |
Bottom camera padding for bounds |
| zoomLevel | number |
none |
false |
Zoom level of the map |
| centerCoordinate | array |
none |
false |
Center coordinate on map [lng, lat] |
| centerELoc | string |
none |
false |
Center eloc on map |
| zoomLevel | number |
none |
false |
Zoom level of the map |
| minZoomLevel | number |
none |
false |
FIX ME NO DESCRIPTION |
| maxZoomLevel | number |
none |
false |
FIX ME NO DESCRIPTION |
| maxBounds | shape |
none |
false |
Restrict map panning so that the center is within these bounds |
| ne | array |
none |
true |
northEastCoordinates - North east coordinate of bound |
| sw | array |
none |
true |
southWestCoordinates - South west coordinate of bound |
| followUserLocation | bool |
none |
false |
Should the map orientation follow the user's. |
| followUserMode | enum |
none |
false |
The mode used to track the user location on the map. One of; "normal", "compass", "course". Each mode string is also available as a member on the MapmyIndiaGL.UserTrackingModes object. Follow (normal), FollowWithHeading (compass), FollowWithCourse (course). NOTE: followUserLocation must be set to true for any of the modes to take effect |
| followZoomLevel | number |
none |
false |
FIX ME NO DESCRIPTION |
| followPitch | number |
none |
false |
FIX ME NO DESCRIPTION |
| followHeading | number |
none |
false |
FIX ME NO DESCRIPTION |
| triggerKey | any |
none |
false |
FIX ME NO DESCRIPTION |
| alignment | array |
none |
false |
FIX ME NO DESCRIPTION |
| onUserTrackingModeChange | func |
none |
false |
FIX ME NO DESCRIPTION |
| isUserInteraction | FIX ME UNKNOWN TYPE |
false |
false |
FIX ME NO DESCRIPTION |
Map camera transitions to fit provided bounds
| Name | Type | Required | Description |
|---|---|---|---|
northEastCoordinates |
Array |
Yes |
North east coordinate of bound |
southWestCoordinates |
Array |
Yes |
South west coordinate of bound |
padding |
Number |
No |
Camera padding for bound |
animationDuration |
Number |
No |
Duration of camera animation |
this.camera.fitBounds([lng, lat], [lng, lat])
this.camera.fitBounds([lng, lat], [lng, lat], 20, 1000) // padding for all sides
this.camera.fitBounds([lng, lat], [lng, lat], [verticalPadding, horizontalPadding], 1000)
this.camera.fitBounds([lng, lat], [lng, lat], [top, right, bottom, left], 1000)Map camera will fly to new coordinate
| Name | Type | Required | Description |
|---|---|---|---|
coordinates |
Array |
Yes |
Coordinates that map camera will jump too |
animationDuration |
Number |
No |
Duration of camera animation |
this.camera.flyTo([lng, lat])
this.camera.flyTo([lng, lat], 12000)Map camera will fly to new coordinate
| Name | Type | Required | Description |
|---|---|---|---|
eloc |
string |
Yes |
Coordinates that map camera will jump too |
animationDuration |
Number |
No |
Duration of camera animation |
this.camera.flyWithEloc("MMI000")
this.camera.flyWithEloc("MMI000", 12000)Map camera will move to new coordinate at the same zoom level
| Name | Type | Required | Description |
|---|---|---|---|
coordinates |
Array |
Yes |
Coordinates that map camera will move too |
animationDuration |
Number |
No |
Duration of camera animation |
this.camera.moveTo([lng, lat], 200) // eases camera to new location based on duration
this.camera.moveTo([lng, lat]) // snaps camera to new location without any easingMap camera will move to new coordinate at the same zoom level
| Name | Type | Required | Description |
|---|---|---|---|
eloc |
string |
Yes |
Coordinates that map camera will move too |
animationDuration |
Number |
No |
Duration of camera animation |
this.camera.moveWithEloc("MMI000", 200) // eases camera to new location based on duration
this.camera.moveWithEloc("MMI000") // snaps camera to new location without any easingMap camera will zoom to specified level
| Name | Type | Required | Description |
|---|---|---|---|
zoomLevel |
Number |
Yes |
Zoom level that the map camera will animate too |
animationDuration |
Number |
No |
Duration of camera animation |
this.camera.zoomTo(16)
this.camera.zoomTo(16, 100)Map camera will perform updates based on provided config. Advanced use only!
| Name | Type | Required | Description |
|---|---|---|---|
config |
Object |
Yes |
Camera configuration |
this.camera.setCamera({
centerCoordinate: [lng, lat],
zoomLevel: 16,
animationDuration: 2000,
})
this.camera.setCamera({
stops: [
{ pitch: 45, animationDuration: 200 },
{ heading: 180, animationDuration: 300 },
]
})For any queries and support, please contact:
Email us at apisupport@mapmyindia.com
Ask a question under the mapmyindia-api
Need support? contact us!
Read about the latest updates & customer stories
Copyright 2021. CE Info Systems Pvt. Ltd. All Rights Reserved. | Terms & Conditions
mapbox-gl-native copyright (c) 2014-2018 Mapbox.
- Installation Guides
- Components
- Sources
- Layers
- Widgets
- Set MapmyIndia Style
- Rest Api's
