@sgiehl opened this Issue on August 3rd 2017 Member

Our map wasn't updated for some years and some stuff is shown wrong or is incomplete.
Unfortunately our map generator (https://github.com/piwik/piwik-map-generator) is outdated and doesn't work anymore.

We either should try to get the old generator working again or look out for some completely new maps.

Would be awesome if we would find some volunteer for this project, as we currently have more important issues and won't be able to handle this soon.

Summary of Issues that should be resolved with new maps:
#11266, #10963, #10123, #9719, #9170, #321, #13347 and maybe others

@fengkaijia commented on September 21st 2017 Contributor

Adding to the issue board: Hong Kong and Macao are missing from the map (not in either World/Asia/China view). I guess the same goes to a few European city-size country/regions as well, e.g. the Holy See. How about moving to Highmaps (and add an option to allow non-commercial users to switch to it).

@mattab commented on September 21st 2017 Member

How about moving to Highmaps (and add an option to allow non-commercial users to switch to it).

Their license is not compatible with the GNU/GPL so we can't use it

@tassoman commented on November 29th 2019 Contributor

I dunno if you're interested but why overhelming the project with map building (going outside the matter of analytics) while there are already good mapping projects outta there?

I mean can be interesting having a ready made map based on leaflet.js filled with OpenStreetMap open data, or maybe a d3-geo based project?

@Findus23 commented on November 29th 2019 Member

@tassoman I don't know any specifics yet, but using one of those is pretty much what is planned.

@tsteur commented on November 29th 2019 Member

@tassoman yes 99% likely we will use some existing solution as building a maps is a project in itself which we don't want to do. Better for us to focus on analytics :)

There is also https://github.com/markmarkoh/datamaps (based on d3 though) and https://github.com/10bestdesign/jqvmap and a few other ones.

@mattab commented on February 20th 2020 Member

Suggested next step: research for maybe 1 or 2 days and trying quickly whether any of the libs above could work for us.

@fengkaijia commented on February 21st 2020 Contributor

ECharts (https://github.com/apache/incubator-echarts) might also work, it reads GeoJSON and provides a built-in world map.

For provincial level maps, we still need to generate the GeoJSON by ourselves, from sources like shapefiles, such as naturalearthdata.com. You may refer to some examples with ECharts from https://github.com/echarts-maps/echarts-countries-js.

@Findus23 commented on February 21st 2020 Member

ECharts looks like a huge charting library that can also do geoplots. Maybe we should go for something simpler.

My idea would be
-> Downloading shapefiles from naturalearthdata.com
-> writing a nodejs script that converts it to geojson
-> I would recommend to use topojson as it is an extension of geojson specifically for map borders. It is able to unify borders between area and takes less space and most importantly allows to simplify the border shape while still keeping the topology intact (so no gaps between countries due to rounding).
I'm doing something similar (but simpler) here where I store parking district areas.
Topojson can be very simply converted back to geojson on the frontend.
https://medium.com/@mbostock/command-line-cartography-part-1-897aa8f8ca2c is a bit old but a good guide for all of this.
mapshaper also allows to do multiple of these steps in one tool, so it is worth looking at
For displaying the map I think we have two different directions we could go with creating the map.

Either stay with stylized simple maps, render them e.g. with d3 similar to http://bl.ocks.org/michellechandra/0b2ce4923dc9b5809922. This would probably allows a quite quick and responsive interface and nice visualizations (as the countries are just SVG shapes again and can be styled easily). But we would probably just like now have fixed views of continents, countries, etc.

Or we go the leaflet route. This would mean that we have one map where one could zoom and pan freely, clicks on countries could zoom in on them. This would allow more posibilties (like simply adding more map layers with "real' maps. But it would also take more resources (my map has quite few lines on it, but is already not that fluid) and possibly be less responsive.

http://bl.ocks.org/mpmckenna8/af23032b41f0ea1212563b523e859228 is a great demo for this.

Personally I'd go with the first method as I think it will be the nicer user experience for Matomo users (simple county maps could load very quickly into a small svg and not need slow initializing of whole map rendering which allows them to be shown in more places in Matomo), but the second method might be easier to program and is what I have more experience with.

Powered by GitHub Issue Mirror