diff --git a/static/js/map.js b/static/js/map.js deleted file mode 100644 index 9bf6705..0000000 --- a/static/js/map.js +++ /dev/null @@ -1,40 +0,0 @@ -import wsChannel from './WebSocketChannel.js'; -import Hashroute from './Hashroute.js'; -import SimpleCRS from './SimpleCRS.js'; -import CoordinatesDisplay from './CoordinatesDisplay.js'; -import WorldInfoDisplay from './WorldInfoDisplay.js'; -import SearchControl from './SearchControl.js'; -import Overlaysetup from './Overlaysetup.js'; -import layerManager from './LayerManager.js'; - -export function setup(cfg){ - - var map = L.map('image-map', { - minZoom: 2, - maxZoom: 12, - center: Hashroute.getCenter(), - zoom: Hashroute.getZoom(), - crs: SimpleCRS - }); - - map.attributionControl.addAttribution('Minetest Mapserver'); - - var overlays = {}; - - layerManager.setup(wsChannel, cfg.layers, map, Hashroute.getLayerId()); - - //All overlays - Overlaysetup(cfg, map, overlays, wsChannel, layerManager); - - new CoordinatesDisplay({ position: 'bottomleft' }).addTo(map); - new WorldInfoDisplay(wsChannel, { position: 'bottomright' }).addTo(map); - - if (cfg.enablesearch){ - new SearchControl(wsChannel, { position: 'topright' }).addTo(map); - } - - //layer control - L.control.layers(layerManager.layerObjects, overlays, { position: "topright" }).addTo(map); - - Hashroute.setup(map, layerManager); -} diff --git a/static/js/CoordinatesDisplay.js b/static/js/map/CoordinatesDisplay.js similarity index 100% rename from static/js/CoordinatesDisplay.js rename to static/js/map/CoordinatesDisplay.js diff --git a/static/js/Hashroute.js b/static/js/map/Hashroute.js similarity index 100% rename from static/js/Hashroute.js rename to static/js/map/Hashroute.js diff --git a/static/js/LayerManager.js b/static/js/map/LayerManager.js similarity index 100% rename from static/js/LayerManager.js rename to static/js/map/LayerManager.js diff --git a/static/js/components/Map.js b/static/js/map/MapComponent.js similarity index 80% rename from static/js/components/Map.js rename to static/js/map/MapComponent.js index 9bb358b..4458d54 100644 --- a/static/js/components/Map.js +++ b/static/js/map/MapComponent.js @@ -1,10 +1,10 @@ -import wsChannel from '../WebSocketChannel.js'; -import SimpleCRS from '../SimpleCRS.js'; -import CoordinatesDisplay from '../CoordinatesDisplay.js'; -import WorldInfoDisplay from '../WorldInfoDisplay.js'; -import SearchControl from '../SearchControl.js'; -import Overlaysetup from '../Overlaysetup.js'; -import layerManager from '../LayerManager.js'; +import wsChannel from './WebSocketChannel.js'; +import SimpleCRS from './SimpleCRS.js'; +import CoordinatesDisplay from './CoordinatesDisplay.js'; +import WorldInfoDisplay from './WorldInfoDisplay.js'; +import SearchControl from './SearchControl.js'; +import Overlaysetup from './Overlaysetup.js'; +import layerManager from './LayerManager.js'; import config from '../config.js'; export default { diff --git a/static/js/Overlaysetup.js b/static/js/map/Overlaysetup.js similarity index 100% rename from static/js/Overlaysetup.js rename to static/js/map/Overlaysetup.js diff --git a/static/js/RealtimeTileLayer.js b/static/js/map/RealtimeTileLayer.js similarity index 100% rename from static/js/RealtimeTileLayer.js rename to static/js/map/RealtimeTileLayer.js diff --git a/static/js/SearchControl.js b/static/js/map/SearchControl.js similarity index 79% rename from static/js/SearchControl.js rename to static/js/map/SearchControl.js index 1aa228f..8aefdf0 100644 --- a/static/js/SearchControl.js +++ b/static/js/map/SearchControl.js @@ -1,5 +1,5 @@ -import SearchMenu from './search/SearchMenu.js'; -import SearchInput from './search/SearchInput.js'; +import SearchMenu from '../search/SearchMenu.js'; +import SearchInput from '../search/SearchInput.js'; export default L.Control.extend({ initialize: function(wsChannel, opts) { diff --git a/static/js/SimpleCRS.js b/static/js/map/SimpleCRS.js similarity index 100% rename from static/js/SimpleCRS.js rename to static/js/map/SimpleCRS.js diff --git a/static/js/WorldInfoDisplay.js b/static/js/map/WorldInfoDisplay.js similarity index 100% rename from static/js/WorldInfoDisplay.js rename to static/js/map/WorldInfoDisplay.js diff --git a/static/js/overlays/ATMOverlay.js b/static/js/map/overlays/ATMOverlay.js similarity index 100% rename from static/js/overlays/ATMOverlay.js rename to static/js/map/overlays/ATMOverlay.js diff --git a/static/js/overlays/AbstractGeoJsonOverlay.js b/static/js/map/overlays/AbstractGeoJsonOverlay.js similarity index 100% rename from static/js/overlays/AbstractGeoJsonOverlay.js rename to static/js/map/overlays/AbstractGeoJsonOverlay.js diff --git a/static/js/overlays/AbstractIconOverlay.js b/static/js/map/overlays/AbstractIconOverlay.js similarity index 100% rename from static/js/overlays/AbstractIconOverlay.js rename to static/js/map/overlays/AbstractIconOverlay.js diff --git a/static/js/overlays/BonesOverlay.js b/static/js/map/overlays/BonesOverlay.js similarity index 100% rename from static/js/overlays/BonesOverlay.js rename to static/js/map/overlays/BonesOverlay.js diff --git a/static/js/overlays/BorderOverlay.js b/static/js/map/overlays/BorderOverlay.js similarity index 100% rename from static/js/overlays/BorderOverlay.js rename to static/js/map/overlays/BorderOverlay.js diff --git a/static/js/overlays/DigitermOverlay.js b/static/js/map/overlays/DigitermOverlay.js similarity index 100% rename from static/js/overlays/DigitermOverlay.js rename to static/js/map/overlays/DigitermOverlay.js diff --git a/static/js/overlays/LabelOverlay.js b/static/js/map/overlays/LabelOverlay.js similarity index 100% rename from static/js/overlays/LabelOverlay.js rename to static/js/map/overlays/LabelOverlay.js diff --git a/static/js/overlays/LcdOverlay.js b/static/js/map/overlays/LcdOverlay.js similarity index 100% rename from static/js/overlays/LcdOverlay.js rename to static/js/map/overlays/LcdOverlay.js diff --git a/static/js/overlays/LocatorOverlay.js b/static/js/map/overlays/LocatorOverlay.js similarity index 100% rename from static/js/overlays/LocatorOverlay.js rename to static/js/map/overlays/LocatorOverlay.js diff --git a/static/js/overlays/LuacontrollerOverlay.js b/static/js/map/overlays/LuacontrollerOverlay.js similarity index 100% rename from static/js/overlays/LuacontrollerOverlay.js rename to static/js/map/overlays/LuacontrollerOverlay.js diff --git a/static/js/overlays/MinecartOverlay.js b/static/js/map/overlays/MinecartOverlay.js similarity index 100% rename from static/js/overlays/MinecartOverlay.js rename to static/js/map/overlays/MinecartOverlay.js diff --git a/static/js/overlays/MissionOverlay.js b/static/js/map/overlays/MissionOverlay.js similarity index 100% rename from static/js/overlays/MissionOverlay.js rename to static/js/map/overlays/MissionOverlay.js diff --git a/static/js/overlays/PlayerOverlay.js b/static/js/map/overlays/PlayerOverlay.js similarity index 100% rename from static/js/overlays/PlayerOverlay.js rename to static/js/map/overlays/PlayerOverlay.js diff --git a/static/js/overlays/PoiOverlay.js b/static/js/map/overlays/PoiOverlay.js similarity index 100% rename from static/js/overlays/PoiOverlay.js rename to static/js/map/overlays/PoiOverlay.js diff --git a/static/js/overlays/PrivProtectorOverlay.js b/static/js/map/overlays/PrivProtectorOverlay.js similarity index 100% rename from static/js/overlays/PrivProtectorOverlay.js rename to static/js/map/overlays/PrivProtectorOverlay.js diff --git a/static/js/overlays/ProtectorOverlay.js b/static/js/map/overlays/ProtectorOverlay.js similarity index 100% rename from static/js/overlays/ProtectorOverlay.js rename to static/js/map/overlays/ProtectorOverlay.js diff --git a/static/js/overlays/ShopOverlay.js b/static/js/map/overlays/ShopOverlay.js similarity index 100% rename from static/js/overlays/ShopOverlay.js rename to static/js/map/overlays/ShopOverlay.js diff --git a/static/js/overlays/TechnicAnchorOverlay.js b/static/js/map/overlays/TechnicAnchorOverlay.js similarity index 100% rename from static/js/overlays/TechnicAnchorOverlay.js rename to static/js/map/overlays/TechnicAnchorOverlay.js diff --git a/static/js/overlays/TechnicQuarryOverlay.js b/static/js/map/overlays/TechnicQuarryOverlay.js similarity index 100% rename from static/js/overlays/TechnicQuarryOverlay.js rename to static/js/map/overlays/TechnicQuarryOverlay.js diff --git a/static/js/overlays/TechnicSwitchOverlay.js b/static/js/map/overlays/TechnicSwitchOverlay.js similarity index 100% rename from static/js/overlays/TechnicSwitchOverlay.js rename to static/js/map/overlays/TechnicSwitchOverlay.js diff --git a/static/js/overlays/TrainOverlay.js b/static/js/map/overlays/TrainOverlay.js similarity index 100% rename from static/js/overlays/TrainOverlay.js rename to static/js/map/overlays/TrainOverlay.js diff --git a/static/js/overlays/TrainlineOverlay.js b/static/js/map/overlays/TrainlineOverlay.js similarity index 100% rename from static/js/overlays/TrainlineOverlay.js rename to static/js/map/overlays/TrainlineOverlay.js diff --git a/static/js/overlays/TrainsignalOverlay.js b/static/js/map/overlays/TrainsignalOverlay.js similarity index 100% rename from static/js/overlays/TrainsignalOverlay.js rename to static/js/map/overlays/TrainsignalOverlay.js diff --git a/static/js/overlays/TravelnetOverlay.js b/static/js/map/overlays/TravelnetOverlay.js similarity index 100% rename from static/js/overlays/TravelnetOverlay.js rename to static/js/map/overlays/TravelnetOverlay.js diff --git a/static/js/overlays/XPProtectorOverlay.js b/static/js/map/overlays/XPProtectorOverlay.js similarity index 100% rename from static/js/overlays/XPProtectorOverlay.js rename to static/js/map/overlays/XPProtectorOverlay.js diff --git a/static/js/routes.js b/static/js/routes.js index 376e4b1..bf2128e 100644 --- a/static/js/routes.js +++ b/static/js/routes.js @@ -1,5 +1,5 @@ -import Map from './components/Map.js'; +import MapComponent from './map/MapComponent.js'; var Home = { view: function() { @@ -9,5 +9,5 @@ var Home = { export default { "/": Home, - "/map/:layerId/:zoom/:lon/:lat": Map + "/map/:layerId/:zoom/:lon/:lat": MapComponent }