* TagTransform (cf http://wiki.openstreetmap.org/wiki/Osmosis/TagTransform)
* Import from OSM (is this worth sharing with the XML API stuff?)
+* Load GPX from API
== Other core ==
** Doesn't always update selected tab when you select a new entity
** Doesn't update selected tab when you change the relations on an entity
** Direct click-to-edit of relation role should actually work
+** Double-clicking a relation to edit it comes up with the POIs!
* Dynamic reloading of stylesheet/map_features, so that you don't need to reload the full page when editing them
* If a select name is too long then, the select menu seems to give a horizontal scrollbar instead of the name of the item e.g. cuisine#Coffee Shop
* If you have both inputSets names and buildingAddress, and name= key is filled in then the basic tab will get both, surely only name should be shown and building name should be ignored e.g. cafes. [Actually this was an issue of addr: being missing from one of them, however this may still be a problem for other overlapping inputSets]
** Potlatch 1-style "floaty warnings"
** Should remember which background imagery layer you had previously selected
** Dialog for adding custom imagery url
+* Ctrl-clicking two areas (one inside the other) should create a multipolygon
* B keypress for background source tag
* Bbox-sensitive menu for background imagery
* Mouse wheel zooming
* Quick-search on add-relations-to-way dialog (RelationSelectPanel)
* Bug: when drawing way, escape ends drawing. Should revert to previous way.
* i18n
+* Multiple selection
== Miscellaneous data model ==
* Complete MapCSS support
* 'Light' version without vectorlayer support etc.
* .gz support for OSMConnection
+* Multipolygon rendering for dashedLine, lineDecoration, and WayBitmapFiller
// Iterate through each sublayer, drawing any styles on that layer
if (!sl) { sl=paint.ruleset.getStyles(this.way, tags); }
var drawn:Boolean;
+ var multis:Array=way.findParentRelationsOfType('multipolygon','outer');
+ var inners:Array=[];
+ for each (var m:Relation in multis) {
+ inners=inners.concat(m.findMembersByRole('inner'));
+ }
for (var sublayer:int=10; sublayer>=0; sublayer--) {
if (sl.shapeStyles[sublayer]) {
var s:ShapeStyle=sl.shapeStyles[sublayer];
if (s.dashes && s.dashes.length>0) {
var segments:Array=dashedLine(stroke.graphics,s.dashes);
if (s.line_style) { lineDecoration(stroke.graphics,s,segments); }
- } else { solidLine(stroke.graphics); }
+ } else { solidLines(stroke.graphics,inners); }
drawn=true;
}
// Fill
- if (s.fill_color || s.fill_image) {
+ if ((s.fill_color || s.fill_image) && way.findParentRelationsOfType('multipolygon','inner').length==0) {
fill=new Shape(); addToLayer(fill,FILLSPRITE);
fill.graphics.moveTo(x0,y0);
if (s.fill_image) { new WayBitmapFiller(this,fill.graphics,s); }
else { s.applyFill(fill.graphics); }
- solidLine(fill.graphics);
+ solidLines(fill.graphics,inners);
fill.graphics.endFill();
drawn=true;
}
casing.graphics.moveTo(x0,y0);
s.applyCasingStyle(casing.graphics);
if (s.casing_dashes && s.casing_dashes.length>0) { dashedLine(casing.graphics,s.casing_dashes); }
- else { solidLine(casing.graphics); }
+ else { solidLines(casing.graphics,inners); }
drawn=true;
}
}
// create a generic "way" hitzone sprite
hitzone = new Sprite();
hitzone.graphics.lineStyle(4, 0x000000, 1, false, "normal", CapsStyle.ROUND, JointStyle.ROUND);
- solidLine(hitzone.graphics);
+ solidLines(hitzone.graphics,[]);
addToLayer(hitzone, CLICKSPRITE);
hitzone.visible = false;
setListenSprite(hitzone);
// Draw solid polyline
- public function solidLine(g:Graphics):void {
- var node:Node = way.getNode(0);
+ public function solidLines(g:Graphics,inners:Array):void {
+ solidLine(g,this.way);
+ for each (var w:Way in inners) { solidLine(g,w); }
+ }
+
+ private function solidLine(g:Graphics,w:Way):void {
+ var node:Node = w.getNode(0);
g.moveTo(paint.map.lon2coord(node.lon), paint.map.latp2coord(node.latp));
for (var i:uint = 1; i < way.length; i++) {
- node = way.getNode(i);
+ node = w.getNode(i);
g.lineTo(paint.map.lon2coord(node.lon), paint.map.latp2coord(node.latp));
}
}
public function getTag(key:String):String {
return tags[key];
}
+
+ public function tagIs(key:String,value:String):Boolean {
+ if (!tags[key]) { return false; }
+ return tags[key]==value;
+ }
public function setTag(key:String, value:String, performAction:Function):void {
performAction(new SetTagAction(this, key, value));
return a;
}
+ public function findParentRelationsOfType(type:String, role:String=""):Array {
+ var a:Array=[];
+ for (var o:Object in parents) {
+ if (o is Relation && Relation(o).tagIs('type',type)) {
+ for (var i:uint=0; i<o.length; i++) {
+ if (o.getMember(i).entity==this && o.getMember(i).role==role) {
+ a.push(o);
+ }
+ }
+ }
+ }
+ return a;
+ }
+
public function get parentObjects():Array {
var a:Array=[];
for (var o:Object in parents) { a.push(o); }