Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core refactor #961

Merged
merged 44 commits into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
4938075
Eliminate global locationManager and prefs (now storageManager)
bhousel May 3, 2023
eaf9f76
Rename "WhateverManager" -> "WhateverSystem"
bhousel May 3, 2023
5c3d62d
Eliminate global presetManager (now presetSystem)
bhousel May 10, 2023
c97dc2c
WIP on modernizing services next
bhousel May 12, 2023
009e96f
WIP on modernizing services - Taginfo, Osmose, Nominatim
bhousel May 12, 2023
78eadc8
WIP on modernizing services - ImproveOSM and Keepright
bhousel May 12, 2023
0b7ec86
Fix the QA layer names (case sensitive)
bhousel May 12, 2023
f3a8913
WIP on converting the service tests also
bhousel May 12, 2023
83f9824
WIP on modernizing services - MapWithAI and Esri
bhousel May 15, 2023
3bfa47f
WIP on modernizing services - NSI
bhousel May 15, 2023
06cd5b6
WIP on modernizing services - Mapillary, Kartaview, Streetside
bhousel May 16, 2023
fbf9253
WIP on modernizing services - ServiceOsm
bhousel May 16, 2023
d29721f
Improve use of `this`, avoid hacks like thiz/that
bhousel May 17, 2023
96a3108
Don't instantiate modeDragNote - this is old
bhousel May 17, 2023
1f6047a
entityIDs may be null, so be careful checking .length
bhousel May 17, 2023
7972b04
Rebind this for authLoading and authDone callbacks
bhousel May 17, 2023
3d79049
pacify eslint
bhousel May 17, 2023
e89ac19
Modernize and ES6ify coreValidator -> ValidationSystem
bhousel May 18, 2023
5031e22
urlhash -> urlHashSystem
bhousel May 18, 2023
e5a9eab
rendererPhotos -> photoSystem
bhousel May 18, 2023
01ae920
rendererImagery -> imagerySystem
bhousel May 18, 2023
82bcb63
Modernize and ES6ify rendererFeatures -> FilterSystem
bhousel May 19, 2023
8243099
fileFetcher -> DataLoaderSystem
bhousel May 22, 2023
ff26364
localizer -> LocalizationSystem
bhousel May 26, 2023
6d48e47
Fix many tests
bhousel May 26, 2023
76a3ac9
Make ValidationIssue and ValidationFix ES6 classes
bhousel May 30, 2023
6f08290
RendererMap -> MapSystem, 3dMap -> Map3dSystem
bhousel May 30, 2023
69d29ed
Rely less on event dispatching to trigger deferred rendering
bhousel May 31, 2023
c8b082c
coreRapidContext -> RapidSystem
bhousel Jun 1, 2023
b3a9dc0
coreUploader -> UploaderSystem
bhousel Jun 1, 2023
858ec00
WIP: Modernize and ES6ify coreHistory -> EditSystem
bhousel Jun 2, 2023
8f083b2
Fix various event listeners d3_dispatch -> eventemitter style
bhousel Jun 5, 2023
8683ea1
Moved stuff around, ditched some requestIdleCallbacks we didn't need
bhousel Jun 5, 2023
f0e7897
Replace deprecated PIXI color util functions with the new stuff
bhousel Jun 5, 2023
c18443d
uiInit -> UiSystem
bhousel Jun 6, 2023
1138419
Process smaller chunks in the validation queue
bhousel Jun 6, 2023
e641a2f
Standardize on `ThingCategory`, not `CategoryThing`
bhousel Jun 14, 2023
29d4458
More consistency in the class hierarchy
bhousel Jun 14, 2023
7c9ba02
Trying a more dynamic mapping for all the core components
bhousel Jun 14, 2023
9ce00cf
ES6ify coreContext -> Context
bhousel Jun 14, 2023
b6f1ac8
Systems should all have an id, like other classes
bhousel Jun 15, 2023
3a9e87f
Replace legacy osm-only `modeSelect` with a more modern SelectOsmMode
bhousel Jun 16, 2023
a6821ec
Fix all the tests
bhousel Jun 19, 2023
6fe7e0d
Avoid writing 'null' to the localstorage history key.
bhousel Jun 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 0 additions & 16 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,6 @@ which makes hot code replacement tricky. (ES6 module exports are
Because of this, the parts of Rapid which are designed for customization are exported
as live bound objects that can be overridden at runtime _before initializing the Rapid context_.

### Services

The `Rapid.services` object includes code that talks to other web services.

To replace the OSM service with a custom service that exactly mimics the default OSM service:
```js
Rapid.services.osm = serviceMyOSM;
```

Some services may be removed entirely. For example, to remove the Mapillary service:
```js
Rapid.services.mapillary = undefined;
// or
delete Rapid.services.mapillary;
```


### Background Imagery

Expand Down
14 changes: 7 additions & 7 deletions data/intro_rapid_graph.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,47 @@
"n-2852": {
"__fbid__": "-2852",
"__origid__": "-2852",
"__service__": "fbml",
"__service__": "mapwithai",
"__datasetid__": "rapid_intro_graph",
"id": "n-2852",
"loc": [-85.6297512, 41.9561476]
},
"n-2805": {
"__fbid__": "-2805",
"__origid__": "-2805",
"__service__": "fbml",
"__service__": "mapwithai",
"__datasetid__": "rapid_intro_graph",
"id": "n-2805",
"loc": [-85.6282000, 41.9561500]
},
"n-5150": {
"__fbid__": "-5150",
"__origid__": "-5150",
"__service__": "fbml",
"__service__": "mapwithai",
"__datasetid__": "rapid_intro_graph",
"id": "n-5150",
"loc": [-85.6281089, 41.9561288]
},
"n-5151": {
"__fbid__": "-5151",
"__origid__": "-5151",
"__service__": "fbml",
"__service__": "mapwithai",
"__datasetid__": "rapid_intro_graph",
"id": "n-5151",
"loc": [-85.6278017, 41.9560522]
},
"n-5152": {
"__fbid__": "-5152",
"__origid__": "-5152",
"__service__": "fbml",
"__service__": "mapwithai",
"__datasetid__": "rapid_intro_graph",
"id": "n-5152",
"loc": [-85.6272470, 41.9558580]
},
"w-516": {
"__fbid__": "-516",
"__origid__": "-516",
"__service__": "fbml",
"__service__": "mapwithai",
"__datasetid__": "rapid_intro_graph",
"id": "w-516",
"nodes": ["n-2852", "n-2805", "n-5150", "n-5151", "n-5152"],
Expand All @@ -51,4 +51,4 @@
"name": "Tulip Lane"
}
}
}
}
29 changes: 15 additions & 14 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,21 @@
container.style.padding = '20px';

} else {
var context = Rapid.coreContext()
.assetPath('')
.apiConnections([
{
url: 'https://www.openstreetmap.org',
client_id: 'O3g0mOUuA2WY5Fs826j5tP260qR3DDX7cIIE2R2WWSc',
client_secret: 'b4aeHD1cNeapPPQTrvpPoExqQRjybit6JBlNnxh62uE'
}, {
url: 'https://api06.dev.openstreetmap.org',
client_id: 'zod4KxHLYtOOvr8LTdUIhZqeAtDxzHRoEsaNkMt2pBc',
client_secret: 'wnDUzUidx8CM948E5fgdk89_-IeOOyjfvDhtn0-mX6k'
}
])
.containerNode(container);
const context = new Rapid.Context();
context.containerNode = container;
context.assetPath = '';
context.apiConnections = [
{
url: 'https://www.openstreetmap.org',
client_id: 'O3g0mOUuA2WY5Fs826j5tP260qR3DDX7cIIE2R2WWSc',
client_secret: 'b4aeHD1cNeapPPQTrvpPoExqQRjybit6JBlNnxh62uE'
}, {
url: 'https://api06.dev.openstreetmap.org',
client_id: 'zod4KxHLYtOOvr8LTdUIhZqeAtDxzHRoEsaNkMt2pBc',
client_secret: 'wnDUzUidx8CM948E5fgdk89_-IeOOyjfvDhtn0-mX6k'
}
];

context.init();
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/statistics.html

Large diffs are not rendered by default.

29 changes: 15 additions & 14 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,21 @@
container.style.padding = '20px';

} else {
var context = Rapid.coreContext()
.assetPath('dist/')
.apiConnections([
{
url: 'https://www.openstreetmap.org',
client_id: 'O3g0mOUuA2WY5Fs826j5tP260qR3DDX7cIIE2R2WWSc',
client_secret: 'b4aeHD1cNeapPPQTrvpPoExqQRjybit6JBlNnxh62uE'
}, {
url: 'https://api06.dev.openstreetmap.org',
client_id: 'zod4KxHLYtOOvr8LTdUIhZqeAtDxzHRoEsaNkMt2pBc',
client_secret: 'wnDUzUidx8CM948E5fgdk89_-IeOOyjfvDhtn0-mX6k'
}
])
.containerNode(container);
const context = new Rapid.Context();
context.containerNode = container;
context.assetPath = 'dist/';
context.apiConnections = [
{
url: 'https://www.openstreetmap.org',
client_id: 'O3g0mOUuA2WY5Fs826j5tP260qR3DDX7cIIE2R2WWSc',
client_secret: 'b4aeHD1cNeapPPQTrvpPoExqQRjybit6JBlNnxh62uE'
}, {
url: 'https://api06.dev.openstreetmap.org',
client_id: 'zod4KxHLYtOOvr8LTdUIhZqeAtDxzHRoEsaNkMt2pBc',
client_secret: 'wnDUzUidx8CM948E5fgdk89_-IeOOyjfvDhtn0-mX6k'
}
];

window.context = context; // for debugging
context.init();
}
Expand Down
8 changes: 1 addition & 7 deletions karma.conf.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Karma configuration
// Generated on Wed Sep 01 2021 16:45:06 GMT+0200 (Central European Summer Time)

module.exports = function (config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
Expand Down Expand Up @@ -30,9 +27,6 @@ module.exports = function (config) {
// list of files / patterns to exclude
exclude: [
'test/spec/pixi/*.js',
'test/spec/renderer/features.js',
'test/spec/renderer/map.js',

// Comment the next line to run the OSM renderer-specific unit test, which right now merely exercise the code.
// These tests don't actually make any assertions and therefore always succeed.
'test/spec/renderer/PixiRenderer.js'
Expand Down Expand Up @@ -72,7 +66,7 @@ module.exports = function (config) {
// start these browsers
// available browser launchers: https://www.npmjs.com/search?q=keywords:karma-launcher
browsers: [
'ChromeHeadless',
'ChromeHeadless'
],

// Continuous Integration mode
Expand Down
Loading