Commit bd948f04 authored by Hamer Iboshi's avatar Hamer Iboshi

Fixed Eixo1 subpage with available maps

parent ac3c0eb7
......@@ -31,7 +31,7 @@ import * as data from '../JsonsAntigos/brasil-quilombola/bqe1'
import BuildLineNotFixed from '../Charts/BuildLineNotFixed'
import BuildPie from '../Charts/BuildPie'
import BrasilMap from '../Components/Map';
import { Map, TileLayer, Polygon } from 'react-leaflet';
import { Map, TileLayer, Polygon, Marker, Popup } from 'react-leaflet';
import PageTable from '../Components/PageTable'
import { findFileById, mapNotExists } from '../Components/Communities';
import './Styles/Eixo1.css'
......@@ -146,7 +146,7 @@ class Eixo1 extends Component {
closeModal() {
this.setState({
modalOpen: false,
modalOpen: false
});
}
......@@ -168,21 +168,23 @@ class Eixo1 extends Component {
{this.state.modalOpen ?
<Row>
<Col s={12} l={6}>
{ (this.state.clickedRow && this.state.clickedRow.lat) ?
{ (this.state.clickedRow && (! mapNotExists(this.state.clickedRow.id))) ?
<Map
center={this.state.clickedRow.lat ? [this.state.clickedRow.lat, this.state.clickedRow.lng] : this.shapeMap()[0][0][1]}
zoom={13}
onClick={this.addMarker}
onLocationfound={this.handleLocationFound}
zoom={10}
ref="map"
length={13}
length={16}
>
<Polygon color='#ca3829' positions={this.shapeMap()}/>
}
<TileLayer
attribution="&amp;copy <a href=&quot;http://osm.org/copyright&quot;>OpenStreetMap</a> contributors"
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<Polygon color='#ca3829' positions={this.shapeMap()}/>
<Marker color='#ca3829' position={this.state.clickedRow.lat ? [this.state.clickedRow.lat, this.state.clickedRow.lng] : this.shapeMap()[0][0][1]}>
<Popup>
{((this.state.clickedRow !== null) ? this.state.clickedRow['nome'] : '')}
</Popup>
</Marker>
<TileLayer
attribution="&amp;copy <a href='http://osm.c3sl.ufpr.br/'>OpenStreetMap</a> contributors"
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
</Map> : <span>Não há mapas disponíveis para está comunidade.</span>}
</Col>
<Col s={12} l={6}>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment