import React from "react" import Widget from "../../../canvas/widgets/base" import Tools from "../../../canvas/constants/tools" import { removeKeyFromObject } from "../../../utils/common" import MapImage from "./assets/map.png" import { MinusOutlined, PlayCircleFilled, PlusOutlined } from "@ant-design/icons" import { CustomTkBase } from "../widgets/base" class MapView extends CustomTkBase{ static widgetType = "map_view" static displayName = "Map View" static requiredImports = [ ...CustomTkBase.requiredImports, "import tkintermapview" ] static requirements = ["tkintermapview"] constructor(props) { super(props) this.droppableTags = null const newAttrs = removeKeyFromObject("layout", this.state.attrs) this.state = { ...this.state, widgetName: "Map viewer", size: { width: 400, height: 250 }, } } // componentDidMount(){ // super.componentDidMount() // } generateCode(variableName, parent){ return [ `${variableName} = tkintermapview.TkinterMapView(master=${parent})`, `${variableName}.${this.getLayoutCode()}` ] } getToolbarAttrs(){ const toolBarAttrs = super.getToolbarAttrs() return ({ id: this.__id, widgetName: toolBarAttrs.widgetName, size: toolBarAttrs.size, ...this.state.attrs, }) } renderContent(){ return (
) } } export default MapView