kopia lustrzana https://github.com/JOSM/MapWithAI
Create a paintstyle for features
Signed-off-by: Taylor Smock <smocktaylor@gmail.com>pull/1/head v0.0.2
rodzic
e03241cc06
commit
6bb35a5b26
|
@ -86,6 +86,7 @@ sourceSets {
|
|||
tasks.processResources {
|
||||
from("$projectDir/LICENSE")
|
||||
from("$projectDir/README.md")
|
||||
from("$projectDir/src/resources")
|
||||
}
|
||||
|
||||
archivesBaseName = "rapid"
|
||||
|
|
|
@ -8,6 +8,7 @@ import org.openstreetmap.josm.gui.MainMenu;
|
|||
import org.openstreetmap.josm.plugins.Plugin;
|
||||
import org.openstreetmap.josm.plugins.PluginInformation;
|
||||
import org.openstreetmap.josm.plugins.rapid.backend.RapiDAction;
|
||||
import org.openstreetmap.josm.plugins.rapid.backend.RapiDDataUtils;
|
||||
import org.openstreetmap.josm.plugins.rapid.backend.RapiDMoveAction;
|
||||
|
||||
public final class RapiDPlugin extends Plugin {
|
||||
|
@ -20,5 +21,7 @@ public final class RapiDPlugin extends Plugin {
|
|||
JMenu dataMenu = MainApplication.getMenu().dataMenu;
|
||||
MainMenu.add(dataMenu, new RapiDAction(), false);
|
||||
MainMenu.add(dataMenu, new RapiDMoveAction(), false);
|
||||
|
||||
RapiDDataUtils.addRapiDPaintStyles();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import java.io.InputStream;
|
|||
import java.net.URL;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
|
@ -15,6 +16,10 @@ import org.openstreetmap.josm.data.osm.Node;
|
|||
import org.openstreetmap.josm.data.osm.OsmPrimitive;
|
||||
import org.openstreetmap.josm.data.osm.Relation;
|
||||
import org.openstreetmap.josm.data.osm.Way;
|
||||
import org.openstreetmap.josm.data.preferences.sources.ExtendedSourceEntry;
|
||||
import org.openstreetmap.josm.data.preferences.sources.MapPaintPrefHelper;
|
||||
import org.openstreetmap.josm.data.preferences.sources.SourceEntry;
|
||||
import org.openstreetmap.josm.data.preferences.sources.SourceType;
|
||||
import org.openstreetmap.josm.io.IllegalDataException;
|
||||
import org.openstreetmap.josm.io.OsmReader;
|
||||
import org.openstreetmap.josm.plugins.rapid.RapiDPlugin;
|
||||
|
@ -138,4 +143,15 @@ public final class RapiDDataUtils {
|
|||
}
|
||||
collection.addAll(temporaryCollection);
|
||||
}
|
||||
|
||||
public static void addRapiDPaintStyles() {
|
||||
// TODO figure out how to use the one in the jar file
|
||||
ExtendedSourceEntry rapid = new ExtendedSourceEntry(SourceType.MAP_PAINT_STYLE, "rapid.mapcss",
|
||||
"https://gitlab.com/smocktaylor/rapid/raw/master/src/resources/styles/standard/rapid.mapcss");
|
||||
List<SourceEntry> paintStyles = MapPaintPrefHelper.INSTANCE.get();
|
||||
if (!paintStyles.contains(rapid)) {
|
||||
paintStyles.add(rapid);
|
||||
}
|
||||
MapPaintPrefHelper.INSTANCE.put(paintStyles);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
meta
|
||||
{
|
||||
title: "RapiD";
|
||||
description: "Visualization of RapiD data";
|
||||
author: "Taylor Smock";
|
||||
version: "1_2019-09-21";
|
||||
min-josm-version: "15229";
|
||||
}
|
||||
|
||||
/*******************************************
|
||||
* Set .rapid for all known RapiD datasets *
|
||||
*******************************************/
|
||||
way[source=~/^(?i)(microsoft|digitalglobe)$/] {
|
||||
set .rapid;
|
||||
}
|
||||
|
||||
way.rapid {
|
||||
color: fuchsia;
|
||||
}
|
||||
way.rapid:closed2 {
|
||||
fill-color: fuchsia;
|
||||
}
|
Ładowanie…
Reference in New Issue