pull/1488/head
Fabioomega 2024-03-15 11:48:25 -03:00
rodzic 4f5d8db473
commit f9e2a6b792
4 zmienionych plików z 38 dodań i 6 usunięć

Wyświetl plik

@ -4,6 +4,7 @@ import Map from './components/Map';
import $ from 'jquery';
import PropTypes from 'prop-types';
import { _, interpolate } from './classes/gettext';
import update from 'immutability-helper';
class MapView extends React.Component {
static defaultProps = {
@ -48,11 +49,13 @@ class MapView extends React.Component {
this.state = {
selectedMapType,
tiles: this.getTilesByMapType(selectedMapType)
tiles: this.getTilesByMapType(selectedMapType),
AIEnabled: false
};
this.getTilesByMapType = this.getTilesByMapType.bind(this);
this.handleMapTypeButton = this.handleMapTypeButton.bind(this);
this.handleAIBtnClick = this.handleAIBtnClick.bind(this);
}
getTilesByMapType(type){
@ -75,13 +78,23 @@ class MapView extends React.Component {
handleMapTypeButton(type){
return () => {
this.setState({
selectedMapType: type,
tiles: this.getTilesByMapType(type)
});
this.setState(update(this.state, {
$merge: {
selectedMapType: type,
tiles: this.getTilesByMapType(type)
}
}));
};
}
handleAIBtnClick() {
this.setState(update(this.state, {
AIEnabled: {$set: !this.state.AIEnabled}
}));
}
render(){
let mapTypeButtons = [
{
@ -118,6 +131,11 @@ class MapView extends React.Component {
onClick={this.handleMapTypeButton(mapType.type)}
className={"btn rounded-corners " + (mapType.type === this.state.selectedMapType ? "selected-button" : "default-button")}><i className={mapType.icon}></i> {mapType.label}</button>
)}
<button
key={100}
onClick={this.handleAIBtnClick}
className={'btn rounded-corners AI-btn ' + (this.state.AIEnabled ? "selected-button" : "default-button")}
><i className='glyphicon glyphicon-screenshot'></i> AI</button>
</div>
{this.props.title ?

Wyświetl plik

@ -55,7 +55,7 @@ export function addTempLayer(file, cb) {
return {
opacity: 1,
fillOpacity: 0.7,
color: getColor()
color: '#99ff99'
}
},
//for point layers

Wyświetl plik

@ -133,6 +133,12 @@ class Map extends React.Component {
async.each(tiles, (tile, done) => {
const { url, meta, type } = tile;
window.this_map_info = {
id: meta.task.id,
project: meta.task.project
}
let metaUrl = url + "metadata";

Wyświetl plik

@ -112,6 +112,14 @@
margin-top: 0px;
margin-bottom: 0px;
}
&.AI-btn {
font-size: 13px;
i {
padding-right: 1px;
}
}
}
}