Pārlūkot izejas kodu

fix 修改地图logo、名称等

Jay 4 dienas atpakaļ
vecāks
revīzija
f9cb5a8e53
7 mainītis faili ar 12 papildinājumiem un 12 dzēšanām
  1. 1 1
      package.json
  2. 1 0
      public/index.html
  3. 1 0
      public/logo.svg
  4. 1 2
      src/ctrl/VectorDataManager.js
  5. 3 3
      src/index.js
  6. 1 1
      src/view/App.js
  7. 4 5
      src/view/Map.js

+ 1 - 1
package.json

@@ -1,5 +1,5 @@
 {
-  "name": "indoor-monitor",
+  "name": "map-indoor",
   "version": "0.1.0",
   "description": "Web Monitor for showing indoors data",
   "main": "index.js",

+ 1 - 0
public/index.html

@@ -22,6 +22,7 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH RE
 	<meta name="author" content="Adrien PAVIE (PanierAvide)" />
 	<meta name="copyright" content="&copy; Adrien PAVIE 2019, Daimler AG 2019" />
 	<link rel="stylesheet" type="text/css" href="%PUBLIC_URL%/style.css" />
+	<link rel="icon" href="%PUBLIC_URL%/logo.svg" />
 	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=1" />
 </head>
 <body>

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 0
public/logo.svg


+ 1 - 2
src/ctrl/VectorDataManager.js

@@ -1259,8 +1259,7 @@ class VectorDataManager extends HistorizedManager {
 
 			try {
 				changesetId = await this._osmApi.createChangeset(
-					// window.EDITOR_NAME + ' ' + PACKAGE.version,
-					PACKAGE.name + ' ' + PACKAGE.version,
+					window.MAP_NAME + ' ' + PACKAGE.version,
 					tags.comment || "Edited building indoors",
 					mytags
 				);

+ 3 - 3
src/index.js

@@ -28,7 +28,7 @@ window.UNUSABLE_ICONS = new Set();
 // 	.then(configTxt => {
 // 		console.log(configTxt)
 // 		window.CONFIG = JSON.parse(configTxt);
-// 		window.EDITOR_NAME = window.CONFIG.editor_name;
+// 		window.MAP_NAME = window.CONFIG.map_name;
 
 // 		// Create app
 // 		new App();
@@ -39,7 +39,7 @@ window.UNUSABLE_ICONS = new Set();
 // 	});
 
 window.CONFIG = JSON.parse(`{
-	"editor_name": "飞兔地图",
+	"map_name": "BunnyBlitzMap",
 	"hash": "GIT_HASH",
 	"data_min_zoom": 18,
 	"map_initial_zoom": 18,
@@ -53,7 +53,7 @@ window.CONFIG = JSON.parse(`{
 	"always_authenticated": false
 }`);
 
-window.EDITOR_NAME = window.CONFIG.editor_name;
+window.MAP_NAME = window.CONFIG.map_name;
 
 // // Create app
 // let app = new App({ el: 'root', id: 'swa3s5ex', url: "ws://121.42.8.157:19702" })

+ 1 - 1
src/view/App.js

@@ -66,7 +66,7 @@ export default class App {
 	_initView() {
 		// ref={child => this.View = child}
 		ReactDOM.render(<Body {...this.state} ref={child => this.View = child.map} />, document.getElementById(this.el));
-		// document.title = window.EDITOR_NAME;
+		// document.title = window.MAP_NAME;
 
 		// Disabling context menu
 		document.oncontextmenu = () => {

+ 4 - 5
src/view/Map.js

@@ -458,8 +458,7 @@ class MyMap extends Component {
 				boxZoom={false}
 			>
 				<AttributionControl
-					// prefix={window.EDITOR_NAME + " v" + PACKAGE.version}
-					prefix={PACKAGE.name + " v" + PACKAGE.version}
+					prefix={window.MAP_NAME + " v" + PACKAGE.version}
 				/>
 
 				<ScaleControl
@@ -651,7 +650,7 @@ class MyMap extends Component {
 		});
 
 		PubSub.subscribe("map.event.bind", (msg, data) => {
-			if(data.eventName === 'contextmenu'){
+			if (data.eventName === 'contextmenu') {
 				this.elem.leafletElement.addEventListener(data.eventName, data.callback);
 				return;
 			}
@@ -659,11 +658,11 @@ class MyMap extends Component {
 		});
 
 		PubSub.subscribe("map.event.unbind", (msg, data) => {
-			if(data.eventName === 'contextmenu'){
+			if (data.eventName === 'contextmenu') {
 				this.elem.leafletElement.removeEventListener(data.eventName, data.callback);
 				return;
 			}
-			if(!data.callback){
+			if (!data.callback) {
 				this.elem.leafletElement.off(data.eventName);
 				return;
 			}