Comments (7)
https://dev.treetracker.org/@zaven?focus=3.882756877719757,0.17578125,2z
from treetracker-web-map-client.
I think in our case, the easiest way is to just rewrite the path with the parameter we are using, so it's easy for us to get them from the path and then setting the map in correct state then request the server.
like, this is the code we generate the request for server:
treetracker-web-map-client/src/map.js
Lines 186 to 205 in a9a02cc
So, if we can fetch the parameter and put then in the path, the next, when we open the app with the same url/parameters, we just need to pass then to the map object and request the server. Something like:
http://treetracker.org/?map_name=freetown&bounds=x,x,x,x
An extra thing that needs to do is to move the map to the bounds by the client.
from treetracker-web-map-client.
@dadiorchen Yes, all other filters are reserved and not influenced
from treetracker-web-map-client.
we found some issues with this PR. query parameters are not retained in the URL when present.
from treetracker-web-map-client.
this PR follows google maps, which was indeed our spec.. but upon review I see that @ also has a special meaning in our platform, the wallet handles, so we have to think differently about how we update the location in the URL.
Some ideas for URLs, not sure which is best
Wallet:
https://dev.treetracker.org/@zaven,3.882756877719757,0.17578125,2z
OR
https://dev.treetracker.org/@zaven?location=3.882756877719757,0.17578125,2z
General query parameters:
https://dev.treetracker.org?map_name=freetown&location=3.882756877719757,0.17578125,2z
from treetracker-web-map-client.
I think in our case, the easiest way is to just rewrite the path with the parameter we are using, so it's easy for us to get them from the path and then setting the map in correct state then request the server.
like, this is the code we generate the request for server:treetracker-web-map-client/src/map.js
Lines 186 to 205 in a9a02cc
So, if we can fetch the parameter and put then in the path, the next, when we open the app with the same url/parameters, we just need to pass then to the map object and request the server. Something like:
http://treetracker.org/?map_name=freetown&bounds=x,x,x,x
An extra thing that needs to do is to move the map to the bounds by the client.
@dadiorchen Thanks for the suggestion, but there is some potential problem reusing bounds query param. When we get bounds information from URL, we cannot use it directly in mapOptions (needs zoom level and center info) in initializationn period, therefore we can only use map.fitBounds() later on to move the map position. But at the same time, we already started to track current bounds and rewrite the bound query param, therefore there would be some potential conflicts with reading and writing.
Currently use a new query param "focus=" in PR #32, let me know you have some other thoughts, thanks.
from treetracker-web-map-client.
@Maxfrank sounds reasonable. Please hold on to this PR for a while, cause I am refactoring the workflow to fit the new cluster tile layer, and I will keep your idea in mind, and let's see how to figure it out when I reach the point.
In your code, did you reserve the filter like map_name=freetown in the URL?
from treetracker-web-map-client.
Related Issues (20)
- The web map release the demo api
- Use turborepo to speed up the development HOT 1
- dev domain ssl problem
- Deploy to dev.treetracker.org by `Deploy version to propreate channel in any environment` is broken HOT 2
- Display the user name when hoving on the avatar icon. HOT 1
- Deploy the postMessage to prod
- Can not jump to bounds on the first view of the `top` page HOT 2
- Optimize the resource consuming of the next.js HOT 1
- Move resources from bundle to public/static folder
- Visualize the steps of wallet api integrate with keycloak.
- Organize the github action in this project, and give a template for other repos
- Use 3rd part action to handle the semantic release HOT 2
- Make the emit happen.
- Add tree growth timeline component to capture page HOT 1
- Deploy the `v2` branch to `alpha` channel HOT 1
- Implement the `organzation` component in the /catpure page HOT 1
- Implment the `tree` page HOT 2
- Move capture page path from: `/v2/captures/{id}` to `/captures/{id}` HOT 6
- Implement the organization page for v2 HOT 3
- Implement the grower page for v2 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from treetracker-web-map-client.