Skip to main content

快速上手

安装#

main package install#

# yarnyarn add maptalksyarn add react-maptalks @react-maptalks/core# yarn with tsyarn add @types/maptalks -D

plugins install#

plugin @react-maptalks/three install#

# yarnyarn add three maptalks.threeyarn add @react-maptalks/three# yarn with tsyarn add @types/three -D

使用#

import { MtMap, MtTileLayer } from 'react-maptalks';const view = { center: [-0.113049,51.49856], pitch: 0 };
<MtMap {...view}>  <MtTileLayer    id={"base"}    urlTemplate="https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png"    subdomains={['a','b','c','d']}    attribution={'&copy; <a href="http://osm.org">OpenStreetMap</a> contributors, &copy; <a href="https://carto.com/">CARTO</a>'}  /></MtMap>