Skip to content

Commit

Permalink
feat: freetown org name use tile server
Browse files Browse the repository at this point in the history
  • Loading branch information
dadiorchen committed Mar 25, 2021
1 parent 2b16855 commit 44cbbf7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/App.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 9 additions & 6 deletions src/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,15 @@ var initMarkers = function(viewportBounds, zoomLevel) {
log.log("request:", queryUrl);
source = CancelToken.source();

//disable loading icon anyway
getApp().loadingB(false);

//for tile server version, if zoom level > 15, and it isn't cases like
//map_name, wallet, then do not request for points, just let the tile
//server works.
if(
queryUrl.match(/zoom_level=(16|17|18|19|20|21|22)/) &&
!queryUrl.match(/(wallet|map_name|timeline|userid|token)/)
isUsingTile
){
log.warn("quit, use tile server instead");
clearOverlays(markers);
Expand All @@ -218,7 +221,6 @@ var initMarkers = function(viewportBounds, zoomLevel) {


//loading
getApp().loadingB(false);
if(!firstRender){
loadingTimer = setTimeout(() => {
getApp().loadingB(true);
Expand Down Expand Up @@ -403,10 +405,11 @@ var initMarkers = function(viewportBounds, zoomLevel) {
// }
});
marker.payload = {
id: item["id"]
id: item["id"],
lat: item["lat"],
lon: item["lon"],
};
//NOTE close, use tile server to render points.
//marker.addTo(map);
marker.addTo(map);

if (
selectedTreeMarker &&
Expand Down Expand Up @@ -889,7 +892,7 @@ var initialize = function() {
googleSat.addTo(map);

//if isn't cases like wallet, org, then use tile
if(!token && !mapName && !treeid && !userid && !wallet){
if(!token && (mapName === undefined || mapName === "freetown") && !treeid && !userid && !wallet){
log.info("use tile server");
isUsingTile = true;
var baseURL_def = process.env.REACT_APP_TILE_SERVER_URL;
Expand Down

0 comments on commit 44cbbf7

Please sign in to comment.