Map

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

NoNameisRequiredTypeDefault valueDescription
1optionstrueMapOptions (opens in a new tab)Các tùy chọn của map
2accessKeytruestringKey api
3versiontruestringVersion của sdk
4onMapReadyfasle(map: any) => voidEvent được gọi sau khi map được tạo
5onClickLocationfasle(args: any) => voidEvent click vào một vị trí trên map
6onRightClickLocationfasle(args: any) => voidEvent right click vào một vị trí trên map
7onCameraChangingfasle(args: any) => voidEvent khi một thông số bất kỳ của camera map thay đổi
8onTilesLoadedfasle(args: any) => voidEvent khi map load xong tất cả các tile ban đầu
9zoomfaslenumberMức zoom
10bearingfaslenumberGóc xoay
11centerfasleLatLng (opens in a new tab)Tâm
12tiltfaslenumberGóc nghiêng
Last updated on April 12, 2023