Map
Sử dụng
demo.js
import * as React from "react";
import { MFMap } from "react-map4d-map";
const DemoMap = () => {
return (
<div style={{ width: "100%", height: "400px" }}>
<MFMap
options={{
center: { lat: 16.072163491469226, lng: 108.22690536081757 },
zoom: 15,
controls: true,
}}
accessKey={"your key"}
version={"2.4"}
/>
</div>
);
};
export default DemoMap;
Kết quả
Props
No | Name | isRequired | Type | Default value | Description |
---|---|---|---|---|---|
1 | options | true | MapOptions (opens in a new tab) | Các tùy chọn của map | |
2 | accessKey | true | string | Key api | |
3 | version | true | string | Version của sdk | |
4 | onMapReady | fasle | (map: any) => void | Event được gọi sau khi map được tạo | |
5 | onClickLocation | fasle | (args: any) => void | Event click vào một vị trí trên map | |
6 | onRightClickLocation | fasle | (args: any) => void | Event right click vào một vị trí trên map | |
7 | onCameraChanging | fasle | (args: any) => void | Event khi một thông số bất kỳ của camera map thay đổi | |
8 | onTilesLoaded | fasle | (args: any) => void | Event khi map load xong tất cả các tile ban đầu | |
9 | zoom | fasle | number | Mức zoom | |
10 | bearing | fasle | number | Góc xoay | |
11 | center | fasle | LatLng (opens in a new tab) | Tâm | |
12 | tilt | fasle | number | Góc nghiêng |
Last updated on April 12, 2023