Basic Use

This example shows a minimal <Map> using a single layer with the <OSM> source. The map's <View> is given an initial set of options. The options property is an object passed to the underlying constructor. You can use this property to configure components that your application will not control or update.

import Map from '@planet/maps/Map.js';
import OSM from '@planet/maps/source/OSM.js';
import React from 'react';
import TileLayer from '@planet/maps/layer/WebGLTile.js';
import View from '@planet/maps/View.js';

function Basic() {
  return (
    <Map>
      <View options={{center: [0, 0], zoom: 1}} />
      <TileLayer>
        <OSM />
      </TileLayer>
    </Map>
  );
}

export default Basic;