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

Get the leaflet map working with CAs #10

Closed
hxu opened this issue Jan 28, 2014 · 9 comments
Closed

Get the leaflet map working with CAs #10

hxu opened this issue Jan 28, 2014 · 9 comments
Assignees
Labels

Comments

@hxu
Copy link
Member

hxu commented Jan 28, 2014

Partially implemented in MapCtrl

@2blam
Copy link
Contributor

2blam commented Jan 28, 2014

I asked Land Survey students to get some idea about the coordinate system. I used another approach to generate the geojson. Please check https://github.com/2blam/HK-geojson The map can show constituency area in Hong Kong. When the mouse clicked on the polygon, it shows the corresponding CA names. @vincentlaucy see if it can help and put it to frontend

@debuggingfuture
Copy link
Contributor

Thanks @2blam,

Example for ref:
http://tombatossals.github.io/angular-leaflet-directive/examples/geojson-example.html

Ideally IMO we can reuse the same map, when click to DC we increase zoom
level and polygons are drawn to geojson of CA inside. zoom out to draw DC
again.
which is more dynamic than
http://www.census2011.gov.hk/en/constituency-area-cnw.html

On Tue, Jan 28, 2014 at 7:01 PM, 2blam notifications@github.com wrote:

I asked Land Survey students to get some idea about the coordinate system.
I used another approach to generate the geojson. Please check
https://github.com/2blam/HK-geojson The map can show constituency area in
Hong Kong. When the mouse clicked on the polygon, it shows the
corresponding CA names. @vincentlaucy https://github.com/vincentlaucysee if it can help and put it to frontend

Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-33468766
.

@hxu
Copy link
Member Author

hxu commented Jan 29, 2014

Sounds like a good strategy to me. So to summarize:

  • Draw DC on map, lightly colored, so that you can see the underlying map. Hover highlights it
  • Clicking on a DC zooms in and draws CAs. lightly colored, and hover highlights the shapes

However, once zoomed into the CA, I would say that you need at least one links next to the map: a Zoom out or Back link to return to the DC view.

The other link may be to Select all, if you wanted to select more than one CA, but it would actually be better if you could do this without zooming into the CA view at all.

Also, I think any implementation should allow toggling of selecting more than one CA. In some cases, we only want to be able to select one CA. In other cases, we may want to select more than one.

@hxu
Copy link
Member Author

hxu commented Jan 31, 2014

@vincentlaucy are you working on the maps tonight? If not, I will take a look at it in a bit.

@ghost ghost assigned hxu Jan 31, 2014
@debuggingfuture
Copy link
Contributor

Not working at it at the moment. Can see anything to help on sun
Am 31.01.2014 19:25 schrieb "hxu" notifications@github.com:

@vincentlaucy https://github.com/vincentlaucy are you working on the
maps tonight? If not, I will take a look at it in a bit.

Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-33786784
.

@hxu
Copy link
Member Author

hxu commented Jan 31, 2014

OK, no worries, it's a holiday, people should be with their families :-).

Just thinking out loud as I work through this: Taking a look at the geojson files, it looks like we still need to do a few things:

  • GeoJSON objects for district councils and constituency areas need their unique identifiers in their features hashes.
  • Can probably strip the rest of the properties from the features hash, though at some point it may be useful to have the area and perimeters of each area.
  • GeoJSON files need to be smaller -- Constituency Areas file is currently 4MB. Should run it through TopoJSON

Next, to implement the actual interface, I will make a directive for the map. Going to plan it out with a spec and tests first, but it should probably implement the following features:

  • Click to select individual CAs
  • Ability to select all CAs within a district at once
  • Show CAs or Districts based on zoom? Not sure about this one yet
  • Different styling for selected vs. non-selected CAs
  • Needs two way binding outside of directive, so that other objects can detect which CAs are selected.

@debuggingfuture
Copy link
Contributor

@2blam did a simplification inside qgis and got a smaller geojson
https://github.com/2blam/HK-geojson
Am 31.01.2014 20:51 schrieb "hxu" notifications@github.com:

OK, no worries, it's a holiday, people should be with their families :-).

Just thinking out loud as I work through this: Taking a look at the
geojson files, it looks like we still need to do a few things:

  • GeoJSON objects for district councils and constituency areas need
    their unique identifiers in their features hashes.
  • Can probably strip the rest of the properties from the featureshash, though at some point it may be useful to have the area and perimeters
    of each area.
  • GeoJSON files need to be smaller -- Constituency Areas file is
    currently 4MB. Should run it through TopoJSONhttp://bost.ocks.org/mike/simplify/

Next, to implement the actual interface, I will make a directive for the
map. Going to plan it out with a spec and tests first, but it should
probably implement the following features:

  • Click to select individual CAs
  • Ability to select all CAs within a district at once
  • Show CAs or Districts based on zoom? Not sure about this one yet
  • Different styling for selected vs. non-selected CAs
  • Needs two way binding outside of directive, so that other objects
    can detect which CAs are selected.

Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-33791447
.

@hxu
Copy link
Member Author

hxu commented Jan 31, 2014

Ah okay, I remember now. Thanks for reminding me.

On Fri, Jan 31, 2014 at 8:59 PM, vincentlaucy notifications@github.comwrote:

@2blam did a simplification inside qgis and got a smaller geojson
https://github.com/2blam/HK-geojson
Am 31.01.2014 20:51 schrieb "hxu" notifications@github.com:

OK, no worries, it's a holiday, people should be with their families :-).

Just thinking out loud as I work through this: Taking a look at the
geojson files, it looks like we still need to do a few things:

  • GeoJSON objects for district councils and constituency areas need
    their unique identifiers in their features hashes.
  • Can probably strip the rest of the properties from the featureshash,
    though at some point it may be useful to have the area and perimeters
    of each area.
  • GeoJSON files need to be smaller -- Constituency Areas file is
    currently 4MB. Should run it through TopoJSON<
    http://bost.ocks.org/mike/simplify/>

Next, to implement the actual interface, I will make a directive for the
map. Going to plan it out with a spec and tests first, but it should
probably implement the following features:

  • Click to select individual CAs
  • Ability to select all CAs within a district at once
  • Show CAs or Districts based on zoom? Not sure about this one yet
  • Different styling for selected vs. non-selected CAs
  • Needs two way binding outside of directive, so that other objects
    can detect which CAs are selected.

Reply to this email directly or view it on GitHub<
https://github.com/hxu/hk_census_explorer/issues/10#issuecomment-33791447>

.


Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-33791842
.

@hxu
Copy link
Member Author

hxu commented Feb 7, 2014

Fixed by pull request

@hxu hxu closed this as completed Feb 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants