Code Monkey home page Code Monkey logo

map-icons-generator's Introduction

Map Icons Generator (MIG)

MIG is simple tool for generating icons (both vector and raster) based on cartographic data. It is quite flexible, you can change color, lines width, margins and of course size of icons. As far as it based on GeoData (TopoJSON) you can easily change projection and it's parameters or filter regions by geo conditions. And you can feed to it any map: world map, country map with administrative borders or even your town map with districts borders.

How to use

By default MIG generates icons for 174 world countries, GeoData is 1:110m natural earth data. If it's just what you want you can change some general parameters directly in the code or with help of GUI on demopage.

If you want more - you can create another input GeoData file and change couple of corresponding code lines. All is quite easy. First of all you have to create TopoJSON file. Make it with help of Command-line TopoJSON application. If you don't have proper data for naming icons inside TopoJSON file - use external .csv or .tsv file. So now you have new input file(s), so update paths for them in the code:

.defer(d3.json, "data/TopoJSON_file.json")
.defer(d3.tsv, "data/external_file_for_names.tsv")

Next step is to change feature name according to your new TopoJSON file:

.data(topojson.feature(world, world.objects.YourNewFeatureName).features

That's all. Now you should be able to generate icons from other GeoData.

Advanced adjustments

Sometimes it is better to use not standard projection, in these cases you can use one of avaliable projections or even create your own. So feel free to experiment.

Further improvements

Add ability for line simplification and quantization as soon as it will be available in topojson.js. Now you can make it only on the stage of creating TopoJSON file. Improve demopage's GUI, add control for filtering GeoData.

Thanks

Thanks to Mike Bostock for great tool โ€” D3.js and to Jason Davies for inspiring example โ€” Countries by area.

map-icons-generator's People

Contributors

kogor avatar

Watchers

James Cloos avatar tushar jagta avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.