ScaleCombo example

This is a example containing a map component and a scale combo

    import React from 'react';
import { render } from 'react-dom';

import OlMap from 'ol/map';
import OlView from 'ol/view';
import OlLayerTile from 'ol/layer/tile';
import OlSourceOsm from 'ol/source/osm';
import olProj from 'ol/proj';

import {
  ScaleCombo
} from '@terrestris/react-geo';

//
// ***************************** SETUP *****************************************
//
const map = new OlMap({
  layers: [
    new OlLayerTile({
      name: 'OSM',
      source: new OlSourceOsm()
    })
  ],
  view: new OlView({
    center: olProj.fromLonLat([37.40570, 8.81566]),
    zoom: 4
  })
});

//
// ***************************** SETUP END *************************************
//

render(
  <div>
    <div className="example-block">
      <label>ScaleCombo:<br />
        <ScaleCombo
          map={map}
          style={{'margin': '5px', 'width': '300px'}}
        />
      </label>
    </div>

    <div id="map" style={{
      height: '400px'
    }} />

  </div>,

  // Target
  document.getElementById('exampleContainer'),

  // Callback
  () => {
    map.setTarget('map');
  }
);