-
Notifications
You must be signed in to change notification settings - Fork 81
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
Router_mixin implemented for SMap router functionality and state control #1326
Conversation
…1.0 (#1077) * Single page map scaffolding view and html. Upgrade single page to Leaflet 1.0 - ProjectMap will server as the main view for all project pages - Side pannel can be displayed or hidden by switching between detail-hidden and detail-display - Upgrade JUST project_map.html to Leaflet 1.0. Since other pages will be absorbed by this one, I am putting off the full upgrade until the other views have been reworked. - Currently only standard tests for ProjectMapView. Will add more as more functionality is added. - Removed L.Deflate temporarily. Running into issues with upgrade to leaflet 1.0 * ripped out django-leaflet. set up js/smap/
* implemented tile->lat/long converter adding L.Deflate back added L.TileLayer.GeoJSON and updated to be compatable with Leaflet 1.0 Currently only loaded spatial resources. Should update to drop SUs when out of view * Lazy tile loading
* Add new L.Deflate, MarkerCluster code; update dashboard map * Make project maps deflatable
- moved default views and urls to async folders - refactored everything to play nicely with django-leaflet
…the current page. Added hooks to the html to allow ajax interception of form submission Handles permission errors are redirects for anonymous and non-permissioned users. added current_active_tab to state to allow for automatic redirecting to last active tab. selected location is now automatically centered on if reached through url. popup updated to show currently viewing Added mobile compatability for displaying and hiding project detail panel Sidebar tabs are updated when switching from map to overview Added onclick to td in location detail resource table
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, it's mostly ok, just have a few comments.
- Editing locations doesn't submit the form; I guess Brian is working on that?!
- When I delete a location, would there be a way to keep the map position and not move it to the project extent? I can see cases, where someone wants to edit a bunch of locations in a neighbourhood; having to back to that area every time you delete something can be really annoying. Same with starting to add a location and then canceling. (In fact, there's research on map usability that suggest to never automatically move the map, unless it's an explicit user action).
- Once I add a resource to one location and then open the details of another location, it opens that location in the resources tab. It's the same when I add a relationship to one locations, all other location open the relationship tab by default.
- Accessing a location via its URL sometimes doesn't zoom to the location on the map. I tested this using a big project; could this be released to the location geometry not yet being loaded onto the map?
- When I go to a resource detail page and then use the browser's back button it doesn't open the resource tab of the location. That's probably because the state is deleted, so maybe there should be a way to add this to the URL to preserve this.
Let me know when you want to go on a call to discuss....
route.eventHook(view_url); | ||
var el = document.getElementById(rm.getRouteElement(route.el)); | ||
$.get(async_url, function(response){ | ||
if (response.includes("alert-warning")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if I like that. Say we include some warning with the same class name in the side, you would always redirect to the overview tab.
Would there be a way to make this more fail-safe. For example, by adding custom headers to the response that we can evaluate on client-side?
{% load leaflet_tags %} | ||
|
||
{% block extra_head %} | ||
{% leaflet_css plugins="groupedlayercontrol,markercluster" %} | ||
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" /> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet-geocoder-mapzen/1.7.1/leaflet-geocoder-mapzen.css"> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet-geocoder-mapzen/1.4.0/leaflet-geocoder-mapzen.css"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason not to keep the newer version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was running into issues with the geocoder's responsiveness, but I think all of that's fixed on master which I haven't rebased to yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right, I think master is on 1.8.x or so. That should be ok then.
<script src="{% static 'js/smap/router.js' %}"></script> | ||
<script src="{% static 'js/smap/map.js' %}"></script> | ||
<script type="text/javascript" src="{% static 'buckets/js/script.js' %}"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet-geocoder-mapzen/1.4.0/leaflet-geocoder-mapzen.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason not to keep the newer version?
Yeah, I was holding off on anything involving the geometries for the time being.
This plays into what I'm working on with the URL map position storage. It would be nice to have a list of expected map behavior for each view/user path.
Dangit thought I fixed that.. will work on that now
Yeah so if the location isn't in the project extent or in the initial screen view, it's not loaded by the tile loader, and that's currently where I'm getting the bounds from. The URL coords will help with that, but I can see situations where people get to a location detail without the coords already attached. I'm open to suggestions on this one...
Hmm.. I'll have to think about this one...
I figured out a better was to do this using headers like you suggested. Fixing it now. I think a call would definitely help if you're available early next week. |
dec2a37
to
c459c8e
Compare
NOTE: NOT BEING MERGED INTO MASTER. BEING MERGED INTO
map-spa-router
Proposed changes in this pull request
When should this PR be merged
Risks
Follow-up actions
Checklist (for reviewing)
General
migration
label if a new migration is added.Functionality
Code
Tests
Security
Documentation