import { onMount, mergeProps, createSignal } from "solid-js"
import { Scene } from '@antv/l7';
import { GaodeMap } from '@antv/l7-maps';
import { useLocation } from "solid-app-router";

import config from "../base/config"

import "./bacgroundMap.css"

import baseText from "../base/baseText"

function itemHead(props) {
    const pathname = useLocation().pathname;
    let dis = false;
    baseText.bottoms.map(v => {
        dis = v.path === pathname ? v.BG : false;
    })
    onMount(() => {
        new Scene({
            id: 'map',
            logoVisible: false,
            map: new GaodeMap({
                style: 'dark',
                center: [108.945, 34.205],
                pitch: 0,
                zoom: 15,
                logoVisible: false,
                token: config.gaodeToken,
            }),
        });
    })
    return <div id="map"></div>
}

export default itemHead;
