Add line sprite

This commit is contained in:
Ansis Brammanis
2013-02-21 11:28:44 -05:00
parent fcdb943d7c
commit 3bffa556fd
5 changed files with 50 additions and 26 deletions

View File

@@ -1,24 +0,0 @@
#!/bin/bash
if [[ -z `which glue` ]] ; then
echo "You need to install glue."
echo "http://glue.readthedocs.org/en/latest/installation.html"
exit 1
fi
MAKIPATH=$1
if [[ -z $MAKIPATH ]]; then
echo "Usage: makesprite PATHTOMAKI"
exit 1
fi
dir=$(dirname $0)
img="$dir/../img"
css="$dir/../css"
glue --namespace=maki --sprite-namespace= $1/renders --css=$css --img=$img
mv $css/renders.css $css/maki.css
mv $img/renders.png $img/maki.png
sed -i 's/renders/maki/' $css/maki.css

36
img/source/makesprite Executable file
View File

@@ -0,0 +1,36 @@
#!/bin/bash
if [[ -z `which glue` ]] ; then
echo "You need to install glue."
echo "http://glue.readthedocs.org/en/latest/installation.html"
exit 1
fi
MAKIPATH=$1
if [[ -z $MAKIPATH ]]; then
echo "Usage: makesprite PATHTOMAKI"
exit 1
fi
dir=$(dirname $0)
img="$dir/.."
css="$dir/../../css"
cd $dir
mkdir preset-icons
cp $MAKIPATH/renders/* preset-icons
rm preset-icons/*-18.png
rm preset-icons/*-12.png
for x in preset-icons/*.png; do
mv $x `echo $x | sed "s/-24//"`
done
cp renders/line-presets/* preset-icons
glue --namespace=preset --sprite-namespace= preset-icons --css=$css --img=$img
rm preset-icons/*
rmdir preset-icons

View File

@@ -6,7 +6,7 @@
<link rel='stylesheet' href='css/reset.css'>
<link rel='stylesheet' href='css/map.css'>
<link rel='stylesheet' href='css/app.css'>
<link rel='stylesheet' href='css/maki.css'>
<link rel='stylesheet' href='css/preset-icons.css'>
<!-- mobile devices -->
<meta name='viewport' content='initial-scale=1.0 maximum-scale=1.0'>

View File

@@ -69,7 +69,7 @@ iD.ui.PresetGrid = function() {
});
entered.append('div')
.attr('class', function(d) { return 'maki-' + d.icon + '-24 icon'; });
.attr('class', function(d) { return 'preset-' + d.icon + ' icon'; });
entered.append('span').attr('class','label').text(name);

View File

@@ -235,5 +235,17 @@
"icon": "hospital",
"form": [
]
},
{
"title": "River",
"name": "river",
"match": {
"type": ["line"],
"tags": {
"waterway": "river"
}
},
"icon": "waterway-river",
"form": []
}
]