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

Maps work - improvement and strengthening of the maps used in Akvo RSR #113

Closed
adriancollier opened this issue Oct 29, 2012 · 13 comments
Closed

Comments

@adriancollier
Copy link
Contributor

We need to perform several tasks to improve the functionality of maps in RSR. Much work on this has been done, but the following list contains requirements that need to be fulfilled by this work.

There are additional existing requirements which are not mentioned here. These include standard requirements such as the ability to view pins relating to organisations on a map. If further clarification of these requirements is needed, please speak to @adriancollier.

  • When there are multiple locations to be displayed on a single object (Project/Organisation), these should be displayed on the map.
  • Primary and Secondary locations should be distinguishable.
  • Zoom levels should be adjusted based on the content of the map - the smaller the spread of the pins, the higher the zoom level.
  • At a low zoom level, the density of pins should be clearly displayed.
  • We should consider an appropriate Zoom level for no pins and for when the pins are loading - at the moment this used high zoom at 0,0 which is the ocean.
  • When many pins appear within a small location, we should consider a clustering solution to group these together for higher visibility.
  • Consolidation of AJAX maps to use a single inclusion tag.
  • The Title of the Object along with the primary image should be present on the pop-up info windows on the map.

These requirements are taken from the following GitHub issues which are closed but can be viewed for reference:
#8 #17 #19 #20 #44 #57 #60 #97

The core bulk of this work has been estimated to take around 2 weeks. Formal initiation of this work will be given shortly along with the assigning of this issue.

A comment at this time will be added to provide the estimated delivery time.

@adriancollier
Copy link
Contributor Author

We should also be looking at #85 when completing this issue.

kardan added a commit that referenced this issue Nov 19, 2012
kardan added a commit that referenced this issue Nov 19, 2012
- Made user of the API's limit and offset features
- Made akvo-maps.js pass jslint

. #113
@kardan
Copy link
Contributor

kardan commented Nov 20, 2012

Now there is a Django template tag "map" that renders a project map with the following syntax:
{% map project 260 180 'static' %}
and
{% map organisation 400 300 'dynamic' %}

For maps with all projects:
{% map 'projects' 975 600 'dynamic' %}

On page load a javascript will grab all map elements from the page and render them with the correct data from the template tag.

I'm consider renaming 'map' to akvomap' or something more namespacy.

@zzgvh
Copy link
Contributor

zzgvh commented Nov 24, 2012

The large maps can't be zoomed with the scroll wheel any more. Was this a conscious decision or just an oversight? I'd really like to have it, unless there's a technical reason for disabling it.

@kardan
Copy link
Contributor

kardan commented Nov 24, 2012

For me I find it annoying to scroll down on the page and then suddenly start to zoom the map instead. But didn't realise that I changed behaviour. Fix is just to change https://github.com/akvo/akvo-rsr/blob/develop/akvo/mediaroot/akvo/js/src/akvo-maps.js#L188 from false to true

@zzgvh
Copy link
Contributor

zzgvh commented Nov 24, 2012

In the general case I agree, in-page scrolling sucks. But this is a map, not some random iframe with a list that didn't fit. So I think it's a tradeoff worth doing since the zooming of a map is so very awkward otherwise. It might be argued that it shouldn't be active on the partner sites home pages, but for the large all-project/org maps where there's nothing but the map on the page and the need to scroll is minimal, I think it should definitely be enabled.

@adriancollier
Copy link
Contributor Author

I agree that we should enable this.

I see from the line reference from Daniel that this should be a relatively easy fix, so I will make this now.

Cross your fingers guys - I'm about to edit the code! :)

adriancollier added a commit that referenced this issue Nov 26, 2012
Adding back the functionality to enable Scroll-Wheel Zooming on the maps.

Subsequent maps changes can look into differentiating this functionality between large and smaller maps.
@adriancollier
Copy link
Contributor Author

This works now in UAT - and doesn't seem to have affected maps on project pages, but has on the Project listing pages. :)

@zzgvh
Copy link
Contributor

zzgvh commented Nov 27, 2012

Map zoom on project main page is too detailed. I think it's maxed in. Compare http://www.akvo.org/rsr/project/674/ and http://aqua4all.akvotest3.org/en/project/674/ which are good with http://uat.akvo.org/rsr/project/674/

@zzgvh zzgvh reopened this Nov 27, 2012
@adriancollier
Copy link
Contributor Author

The map zooming was resolved previously by @peeb I believe within #46 - has this now been taken away?

It is also possible that we need to apply the fix from #46 to all maps rather than just Partner Site maps which is possibly the case...

zzgvh added a commit that referenced this issue Nov 29, 2012
Add non-minified jquery files to enable debugging.

Change loading of jquery to load non-minified versions if DEBUG = True.

Load Google maps js conditionally at the end of rsr/base.html to prevent
loading twice when the script is already included in a template tag.
zzgvh added a commit that referenced this issue Nov 29, 2012
Change the API call for the "large" maps to only retrieve the project or
organisation objects and get them all in one request.

Change the pin rendering to only place a pin for the primary location on
the "large" maps.

Fix small problem with the path to pin images.
zzgvh added a commit that referenced this issue Dec 3, 2012
All single maps displaying locations for a single project or
organisation should now have the same default zoom level (8).

If there are locations very far apart zoom level may be lower.
zzgvh added a commit that referenced this issue Dec 5, 2012
Refactor the parameters for the tag
Get the marker_icon param working
Make the home page markers small
Fix the templates to use the new tag params
zzgvh added a commit that referenced this issue Dec 5, 2012
Add more comments describing the calling aPI for the map template tag
and some comments on the inner  workings of the different parts

Get rid of warnings using jslint

Remove old code
zzgvh added a commit that referenced this issue Dec 7, 2012
world.SITE_UNDER_TEST is used to identify the domain of the server the
tests are run on. This was accidentally changed to be a full page URL
causing breakage in older tests.

Replace a few tabs with spaces.

Small refactoring of one step in project_navigation_steps.py
zzgvh added a commit that referenced this issue Dec 11, 2012
Add 'map_for_project' and 'map_for_organisation' resources that produce
a lean dataset for use with the API driven maps. The resources don't
include any foreign key data except the locations and also excludes a
number of long text fields.
zzgvh added a commit that referenced this issue Dec 12, 2012
Replace the home page map with an image of the map, and set up an image
map for the links on it.
zzgvh added a commit that referenced this issue Dec 12, 2012
@adriancollier
Copy link
Contributor Author

We have multiple locations on Akvo.org maps:
http://akvo.org/rsr/project/404/
But not on Partner Site maps:
http://washalliance.akvoapp.org/en/project/404/

@kardan
Copy link
Contributor

kardan commented Jan 2, 2013

Partner sites uses different and older maps code. The new maps code uses RSR API but since it only returns data (and links) for normal "Normal" RSR, we can't use the same maps code. We need to discuss if there is a need for partner sites specific API or how to attack this problem.

zzgvh added a commit that referenced this issue Jun 20, 2013
The global maps are zooming out too much, probably depending on the pins
being more widely distributed. Fix by adding minZoom to dynamic map type.

The global maps are centering in weird places, probably depending on how
the pins are distributed. Fix by adding centering on LatLng 0.0, 0.0.
zzgvh added a commit that referenced this issue Jun 20, 2013
When the global map for projects is loaded quite a few tiles are missing
initially in Chrome/Safari if zoom is set to 2. Fix by setting zoom to 3
even if this results in the map being a bit more zoomed than needed
initially in some cases.
@ghost ghost assigned zzgvh Jun 27, 2013
@adriancollier
Copy link
Contributor Author

I have created a new issue for adding multiple locations on the Partnersite project pages #235.

@peeb are you able to code check the latest 2 commits from this issue? (Just the ones made in June). All the rest were part of a previous release.

@ghost ghost assigned peeb Jun 27, 2013
@peeb
Copy link
Contributor

peeb commented Jul 8, 2013

Code reviewed.

@MichaelAkvo MichaelAkvo moved this to Done in RSR Dec 8, 2022
@MichaelAkvo MichaelAkvo added this to RSR Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants