Skip to content

Conversation

@lylashukur
Copy link

Change Log

  • Created React Vite template for migration
  • Updated the environment variables
  • Updated exports to match the React template
  • Added CORS setup in APP

@lylashukur lylashukur self-assigned this Apr 12, 2025
Copy link
Member

@dmitri-mcguckin dmitri-mcguckin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pulled down the branch and ran npm run dev and it looks like it still has the default Vite + React web app set up.

Please make sure your latest changes are pushed up so this branch is up-to-date.

Also please add some instructions to frontend/README.md on how to setup and run the dev environment. I.e. how to install dependencies and run the dev server.

@@ -0,0 +1,94 @@
# Custom
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go ahead and delete the entire frontend-next-backup directory.

We will still have a backup of the old history by being able to go back and look at the history in the git repo.

Comment on lines 8 to 24
@view_tiles.route("/<int:zoom>/<int:x>/<int:y>.png")
def get_tile(zoom: int, x: int, y: int):
data_dir = current_app.data_dir
tile_path = abspath(f"{data_dir}/tiles/{zoom}/{x}/{y}.png")

tiles_dir = getattr(current_app, "tiles_dir", "../geo-tiles/tiles")
tile_path = abspath(f"{tiles_dir}/tiles/{zoom}/{x}/{y}.png")
print(f"[TILE DEBUG] Tile path being served: {tile_path}")

#tile_path = abspath(f"{data_dir}/tiles/{zoom}/{x}/{y}.png")
#print(f"[TILE DEBUG] Tile path being served: {tile_path}")



try:
exists(tile_path)
#exists(tile_path)
return send_file(tile_path)
except FileNotFoundError:
return {"err": f"No such tile for {x} by {y} at a zoom of {zoom}"}, 404
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@view_tiles.route("/<int:zoom>/<int:x>/<int:y>.png")
def get_tile(zoom: int, x: int, y: int):
data_dir = current_app.data_dir
tile_path = abspath(f"{data_dir}/tiles/{zoom}/{x}/{y}.png")
tiles_dir = getattr(current_app, "tiles_dir", "../geo-tiles/tiles")
tile_path = abspath(f"{tiles_dir}/tiles/{zoom}/{x}/{y}.png")
print(f"[TILE DEBUG] Tile path being served: {tile_path}")
#tile_path = abspath(f"{data_dir}/tiles/{zoom}/{x}/{y}.png")
#print(f"[TILE DEBUG] Tile path being served: {tile_path}")
try:
exists(tile_path)
#exists(tile_path)
return send_file(tile_path)
except FileNotFoundError:
return {"err": f"No such tile for {x} by {y} at a zoom of {zoom}"}, 404
@view_tiles.route("/<int:zoom>/<int:x>/<int:y>.png")
def get_tile(zoom: int, x: int, y: int):
data_dir = current_app.data_dir
tile_path = abspath(f"{data_dir}/tiles/{zoom}/{x}/{y}.png")
try:
exists(tile_path)
return send_file(tile_path)
except FileNotFoundError:
return {"err": f"No such tile for {x} by {y} at a zoom of {zoom}"}, 404

Go ahead and revert this file to what all is on main.

I see you added the tiles_dir and DEFAULT_TILES_DIR fields which is already accomplished via data_dir and DEFAULT_DATA_DIR.

You may dynamically change what the data-dir is by feeding it in as a cmd line parameter like so:

python -m cesium_api --data-dir ../geo-tiles/tiles

lylashukur and others added 14 commits April 12, 2025 16:05
Co-authored-by: Dmitri McGuckin <28746912+dmitri-mcguckin@users.noreply.github.com>
Co-authored-by: Dmitri McGuckin <28746912+dmitri-mcguckin@users.noreply.github.com>
Co-authored-by: Dmitri McGuckin <28746912+dmitri-mcguckin@users.noreply.github.com>
Co-authored-by: Dmitri McGuckin <28746912+dmitri-mcguckin@users.noreply.github.com>
Co-authored-by: Dmitri McGuckin <28746912+dmitri-mcguckin@users.noreply.github.com>
Co-authored-by: Dmitri McGuckin <28746912+dmitri-mcguckin@users.noreply.github.com>
Co-authored-by: Dmitri McGuckin <28746912+dmitri-mcguckin@users.noreply.github.com>
Co-authored-by: Dmitri McGuckin <28746912+dmitri-mcguckin@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants