Skip to content

Commit 506a5db

Browse files
authored
Merge pull request #179 from mmayeda/84-remove-mainjs-bundle
84 remove mainjs bundle
2 parents acb6bff + 9166571 commit 506a5db

File tree

3 files changed

+10
-49
lines changed

3 files changed

+10
-49
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,15 @@ _check `dist/index.html` for a demo_
115115

116116
# how to debug the core on the client side
117117

118-
The senerio: sometime we need to find a easy way to debug the core in the client side, for example, the web map client repo, it's installing the core by npm, so it's hard to change code in core on the client side, we can install the core by `folder` locally, and get the change on the client side immediately, to do so:
118+
The scenario: sometimes we need to find an easy way to debug the core web map in the parent client side application
119+
(for example, the web map client repo). The web map client repo is installing web map core as a npm package using npm,
120+
so it's hard to change code in core and see the results in the parent client application. One way around this is by
121+
installing web map core by a reference to its local `folder`, which allows changes made to web map core locally
122+
to propagate to the parent client application immediately. To do so:
119123

120-
1. Download the web map core repository, `git clonet [path to repo]`
124+
1. Download the web map core repository: `git clone https://github.com/Greenstand/treetracker-web-map-core.git`
121125
1. Change to code you want in core
122-
1. Change the version number in `package.json` (this is neccessary, if don't do it, it's posssible the client will ignore/skip the installment)
123-
1. Generate the bundle: `npm run pre-publish` (this is nessessary, the npm will fetch the bundle file rather than the src files)
126+
1. Change the version number in `package.json` (this is necessary, if don't do it, it's possible the client will ignore/skip the installment)
127+
1. Generate the bundle: `npm run pre-publish` (this is necessary, the npm will fetch the bundle file rather than the src files)
124128
1. Install the core in web map client: `npm install --save [relative path to the core folder]`
125129
1. Restart the web map client

dist/main.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/Map.js

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/*
2-
* The main model for the treetracker model
2+
* The main model for the treetracker map
33
*/
4-
import regeneratorRuntime from 'regenerator-runtime'
54
import axios from 'axios'
65
import expect from 'expect-runtime'
76
import log from 'loglevel'
@@ -25,8 +24,6 @@ import NearestTreeArrows from './NearestTreeArrows'
2524

2625
class MapError extends Error {}
2726

28-
console.log('Greenstand web map core, version:')
29-
3027
export default class Map {
3128
// events
3229
static REGISTERED_EVENTS = {
@@ -40,7 +37,7 @@ export default class Map {
4037
}
4138

4239
constructor(options) {
43-
// default
40+
// merge constructor parameter options with default map options
4441
const mapOptions = {
4542
...{
4643
L: window.L,
@@ -62,15 +59,8 @@ export default class Map {
6259
this[key] = mapOptions[key]
6360
})
6461

65-
// memeber/properties/statuses
66-
67-
// requester
6862
this.requester = new Requester()
69-
70-
// events
7163
this.events = new EventEmitter()
72-
73-
// mount element
7464
this._mountDomElement = null
7565

7666
log.warn('map core version:', require('../package.json').version)
@@ -640,12 +630,6 @@ export default class Map {
640630
return queryUrl
641631
}
642632

643-
// getClusterRadius(zoomLevel){
644-
// //old code
645-
// //var clusterRadius = getQueryStringValue("clusterRadius") || getClusterRadius(queryZoomLevel);
646-
// return Map.getClusterRadius(zoomLevel);
647-
// }
648-
649633
_goNextPoint() {
650634
log.info('go next tree')
651635
const currentPoint = this.layerSelected.payload
@@ -1423,29 +1407,4 @@ export default class Map {
14231407
clearSelection() {
14241408
this._unselectMarker()
14251409
}
1426-
1427-
// async rerender() {
1428-
// log.info('rerender')
1429-
// log.info('reload tile')
1430-
1431-
// // unslect the current selected point
1432-
// this._unselectMarker()
1433-
1434-
// await this._unloadTileServer()
1435-
1436-
// // load tile
1437-
// if (this.filters.treeid) {
1438-
// log.info('treeid mode do not need tile server')
1439-
// log.info('load tree by id')
1440-
// await this._loadTree(this.filters.treeid)
1441-
// this.tileLoadingMonitor && this.tileLoadingMonitor.destroy()
1442-
// } else if (this.filters.tree_name) {
1443-
// log.info('tree name mode do not need tile server')
1444-
// log.info('load tree by name')
1445-
// this.tileLoadingMonitor && this.tileLoadingMonitor.destroy()
1446-
// await this._loadTree(undefined, this.filters.tree_name)
1447-
// } else {
1448-
// await this._loadTileServer()
1449-
// }
1450-
// }
14511410
}

0 commit comments

Comments
 (0)