Merge branch 'master' of github.com:mapbox/mess.js

This commit is contained in:
Tom MacWright 2011-02-07 11:06:37 -05:00
commit 5ab5d38a26
3 changed files with 117 additions and 34 deletions

View File

@ -30,7 +30,7 @@ tree.FontSet.prototype.toXML = function(env) {
+ this.name + this.name
+ '">\n' + '">\n'
+ this.fonts.map(function(f) { + this.fonts.map(function(f) {
return ' <Font face_name="' + f +'"/>'; return ' <Font face-name="' + f +'"/>';
}).join('\n') }).join('\n')
+ '\n</FontSet>' + '\n</FontSet>'
}; };

View File

@ -1,4 +1,50 @@
{ {
"style": {
"name": {
},
"filter-mode": {
}
},
"meta-writer": {
"name": {
},
"type": {
},
"file": {
},
"default-output": {
},
"output-empty": {
}
},
"font-set": {
"name": {
},
"font": {
"face-name": {
}
}
},
"layer" : {
"name": {
},
"srs": {
},
"status": {
},
"title": {
},
"abstract": {
},
"minzoom": {
},
"maxzoom": {
},
"queryable": {
},
"clear-label-cache": {
}
},
"symbolizers" : { "symbolizers" : {
"map": { "map": {
"background-color": { "background-color": {
@ -12,6 +58,43 @@
"css": "background-image", "css": "background-image",
"type": "uri", "type": "uri",
"description": "Map Background image" "description": "Map Background image"
},
"srs": {
"css": "srs",
"type": "string",
"description": "Map spatial reference (proj4 string)"
},
"buffer-size": {
"css": "buffer",
"api": "buffer-size",
"type": "uri",
"default-value": "0",
"default-meaning": "No buffer will be used",
"description": "Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with 'avoid-edges'."
},
"paths-from-xml": {
"css": "",
"api": "",
"default-value": "true",
"default-meaning": "Paths read from XML will be interpreted from the location of the XML",
"type": "boolean",
"doc": "value to control whether paths in the XML will be interpreted from the location of the XML or from the working directory of the program that calls load_map()"
},
"minimum-version": {
"css": "",
"api": "",
"default-value": "none",
"default-meaning": "Mapnik version will not be detected and no error will be thrown about compatibility",
"type": "string",
"doc": "The minumum Mapnik version (e.g. 0.7.2) needed to use certain functionality in the stylesheet"
},
"font-directory": {
"css": "font-directory",
"type": "uri",
"api": "",
"default-value": "none",
"default-meaning": "No fonts will be registered",
"doc": "Path to a directory which holds fonts which should be registered when the Map is loaded"
} }
}, },
"polygon": { "polygon": {
@ -123,6 +206,16 @@
} }
}, },
"markers": { "markers": {
"file": {
"css": "marker-file",
"type": "uri"
},
"opacity": {
"css": "marker-opacity",
"default-value": 1,
"default-meaning": "opaque",
"type": "float"
},
"stroke": { "stroke": {
"css": "marker-line-color", "css": "marker-line-color",
"type": "color" "type": "color"
@ -163,17 +256,7 @@
"css": "marker-fill", "css": "marker-fill",
"type": "color" "type": "color"
}, },
"opacity": { "allow-overlap": {
"css": "marker-opacity",
"default-value": 1,
"default-meaning": "opaque",
"type": "float"
},
"file": {
"css": "marker-file",
"type": "uri"
},
"allow_overlap": {
"css": "marker-allow-overlap", "css": "marker-allow-overlap",
"type": "boolean", "type": "boolean",
"default-value": "false", "default-value": "false",
@ -184,7 +267,7 @@
"docs": "Space between repeated labels", "docs": "Space between repeated labels",
"type": "float" "type": "float"
}, },
"max_error": { "max-error": {
"css": "marker-max-error", "css": "marker-max-error",
"type": "float" "type": "float"
}, },
@ -210,7 +293,7 @@
"type": "none", "type": "none",
"required": true "required": true
}, },
"face_name": { "face-name": {
"css": "shield-face-name", "css": "shield-face-name",
"type": "string", "type": "string",
"validate": "font", "validate": "font",
@ -227,7 +310,7 @@
"type": "color", "type": "color",
"doc": "The color of the shield text" "doc": "The color of the shield text"
}, },
"minimum_distance": { "minimum-distance": {
"css": "shield-min-distance", "css": "shield-min-distance",
"type": "float", "type": "float",
"default-value": 0, "default-value": 0,
@ -239,13 +322,13 @@
"default-value": 0, "default-value": 0,
"doc": "The spacing between repeated occurrences of the same shield on a line" "doc": "The spacing between repeated occurrences of the same shield on a line"
}, },
"character_spacing": { "character-spacing": {
"css": "shield-spacing", "css": "shield-spacing",
"type": "float", "type": "float",
"default-value": 0, "default-value": 0,
"doc": "Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement." "doc": "Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement."
}, },
"line_spacing": { "line-spacing": {
"css": "shield-line-spacing", "css": "shield-line-spacing",
"doc": "Vertical spacing between lines of multiline labels (in pixels)", "doc": "Vertical spacing between lines of multiline labels (in pixels)",
"type": "float" "type": "float"
@ -309,13 +392,13 @@
"type": "string", "type": "string",
"default-value": "" "default-value": ""
}, },
"shield_dx": { "shield-dx": {
"css": "shield-dx", "css": "shield-dx",
"type": "float", "type": "float",
"doc": "Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the shield right", "doc": "Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the shield right",
"default-value": 0 "default-value": 0
}, },
"shield_dx": { "shield-dx": {
"css": "shield-dx", "css": "shield-dx",
"type": "float", "type": "float",
"doc": "Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the shield down", "doc": "Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the shield down",
@ -449,7 +532,7 @@
"default-meaning": "auto-detected", "default-meaning": "auto-detected",
"doc": "The type of image file, e.g. png" "doc": "The type of image file, e.g. png"
}, },
"allow_overlap": { "allow-overlap": {
"css": "point-allow-overlap", "css": "point-allow-overlap",
"type": "boolean", "type": "boolean",
"default-value": "false", "default-value": "false",
@ -481,7 +564,7 @@
"type": "string", "type": "string",
"required": true "required": true
}, },
"face_name": { "face-name": {
"css": "text-face-name", "css": "text-face-name",
"type": "string", "type": "string",
"validate": "font", "validate": "font",
@ -500,7 +583,7 @@
"type": "float", "type": "float",
"type": "none" "type": "none"
}, },
"wrap_width": { "wrap-width": {
"css": "text-wrap-width", "css": "text-wrap-width",
"doc": "Length of a chunk of text in characters before wrapping text", "doc": "Length of a chunk of text in characters before wrapping text",
"type": "float" "type": "float"
@ -510,23 +593,23 @@
"type": "float", "type": "float",
"doc": "Distance between repeated text labels on a line" "doc": "Distance between repeated text labels on a line"
}, },
"character_spacing": { "character-spacing": {
"css": "text-character-spacing", "css": "text-character-spacing",
"type": "float", "type": "float",
"default-value": 0, "default-value": 0,
"doc": "Horizontal spacing adjustment between characters in pixels" "doc": "Horizontal spacing adjustment between characters in pixels"
}, },
"line_spacing": { "line-spacing": {
"css": "text-line-spacing", "css": "text-line-spacing",
"default-value": 0, "default-value": 0,
"type": "float", "type": "float",
"doc": "Vertical spacing adjustment between lines in pixels" "doc": "Vertical spacing adjustment between lines in pixels"
}, },
"label_position_tolerance": { "label-position-tolerance": {
"css": "text-label-position-tolerance", "css": "text-label-position-tolerance",
"type": "float" "type": "float"
}, },
"max_char_angle_delta": { "max-char-angle-delta": {
"css": "text-max-char-angle-delta", "css": "text-max-char-angle-delta",
"type": "float", "type": "float",
"default-value": "none", "default-value": "none",
@ -538,7 +621,7 @@
"default-value": "#000000", "default-value": "#000000",
"type": "color" "type": "color"
}, },
"halo_fill": { "halo-fill": {
"css": "text-halo-fill", "css": "text-halo-fill",
"docs": "Color of the text halo", "docs": "Color of the text halo",
"type": "color", "type": "color",
@ -546,7 +629,7 @@
"default-meaning": "white", "default-meaning": "white",
"doc": "Specifies the color of the halo around the text." "doc": "Specifies the color of the halo around the text."
}, },
"halo_radius": { "halo-radius": {
"css": "text-halo-radius", "css": "text-halo-radius",
"doc": "Specify the radius of the halo in pixels", "doc": "Specify the radius of the halo in pixels",
"default-value": 0, "default-value": 0,
@ -565,20 +648,20 @@
"doc": "Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down", "doc": "Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down",
"default-value": 0 "default-value": 0
}, },
"avoid_edges": { "avoid-edges": {
"css": "text-avoid-edges", "css": "text-avoid-edges",
"doc": "Tell positioning algorithm to avoid labeling near intersection edges.", "doc": "Tell positioning algorithm to avoid labeling near intersection edges.",
"type": "boolean" "type": "boolean"
}, },
"minimum_distance": { "minimum-distance": {
"css": "text-min-distance", "css": "text-min-distance",
"type": "float" "type": "float"
}, },
"minimum_padding": { "minimum-padding": {
"css": "text-min-padding", "css": "text-min-padding",
"type": "float" "type": "float"
}, },
"allow_overlap": { "allow-overlap": {
"css": "text-allow-overlap", "css": "text-allow-overlap",
"type": "boolean", "type": "boolean",
"default-value": "false", "default-value": "false",
@ -594,7 +677,7 @@
], ],
"default-value": "point" "default-value": "point"
}, },
"text_transform": { "text-transform": {
"css": "text-transform", "css": "text-transform",
"type": [ "type": [
"none", "none",

View File

@ -58,7 +58,7 @@ tree.Rule.prototype.toXML = function(env) {
return ''; return '';
} else if (tree.Reference.isFont(this.name) && this.value.value.length > 1) { } else if (tree.Reference.isFont(this.name) && this.value.value.length > 1) {
var f = tree._getFontSet(env, this.value.value); var f = tree._getFontSet(env, this.value.value);
return 'fontset_name="' + f.name + '"'; return 'fontset-name="' + f.name + '"';
} else { } else {
return tree.Reference.selectorName(this.name) + return tree.Reference.selectorName(this.name) +
'="' + '="' +