Skip to content

api.mapy.cz in jsx

Lubomir Andrisek edited this page Nov 21, 2018 · 3 revisions

Header in template

According to official documentation:

<script src="https://api.mapy.cz/loader.js"></script>
<script>Loader.load()</script>

React Component

import SeznamMap from './SeznamMap.jsx'
<SeznamMap center={this.state.myCenter}
                style={this.state.myStyle]}
                markers={this.state.myInitializationMarkers} />
after calling render() of your parent component you have to add:
require('./SeznamMap.js')
Reason is that seznam map api does not work well inside child component in React.

Clone this wiki locally