If you want to contribute to this project, here is a quick guide:
- Fork the repository
- Develop your code changes
- Commit your changes
- Push to your fork
- Submit a pull request
- Create a new folder
/packages/[new-map]/
and a new file/packages/[new-map]/[new-map].svg
in kebab-case. For example:/packages/new-zealand/new-zealand.svg
- Use tab indentation
- Use only
<svg>
and<path>
tags (no doctype, external stylesheet, comment...). Other tags will be ignored - On the
<svg>
tag:- Set the
xmlns="http://www.w3.org/2000/svg"
namespace declaration - Adjust the
viewBox
attribute to remove any empty space on each side of the map (top, bottom, left, right) - Set an appropriate
aria-label
attributeMap of [New Map]
. For example:Map of New Zealand
- Do NOT use any other attribute than
xmlns
,viewBox
andaria-label
- Set the
- On the
<path>
tags:- Set semantic
id
attributes (short or full names) in kebab-case. For example:ny
for New York ortaipei-city
for Taipei City - Set English
name
attributes - Do NOT use any other attribute than
id
,name
andd
- Set semantic
Here is a simplified example of new-zealand.svg
:
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 703 989"
aria-label="Map of New Zealand"
>
<path
id="auk"
name="Auckland"
d="..."
/>
...
<path
id="wtc"
name="West Coast"
d="..."
/>
</svg>
- Create a new
/packages/[new-map]/package.json
file to describe the npm package to publish:
{
"name": "@svg-maps/[new-map]",
"version": "1.0.0",
"description": "Map of [New Map]",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/VictorCazanave/svg-maps/tree/master/packages/[new-map]"
},
"keywords": [
"svg",
"map",
"[new-map]"
],
"author": "[Your Name] <[your email]>",
"publishConfig": {
"access": "public"
}
}
- Generate the JS file running the
npm run build
command - The
/packages/[new-map]/index.js
file should be generated. Otherwise it means the SVG file is not valid
-
Create a new
/packages/[new-map]/README.md
file to:- list all the locations (states, counties...) alphabetically sorted and using the same names as in the SVG file
- indicate the credits (source, license...)
- describe your modifications
-
Add the new map in the main
README.md
file:- using alphabetical order
- linking to the package folder
/packages/[new-map]