From fecb321504178026cc43b979342e1efdeb8e38de Mon Sep 17 00:00:00 2001 From: Arnoud Buzing Date: Thu, 24 May 2018 14:12:34 -0500 Subject: [PATCH] add LayeredGeoGraphics --- Prototypes/GeoGraphics.wl | 10 +++++++++- Prototypes/PacletInfo.m | 4 ++-- Prototypes/Usage.wl | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Prototypes/GeoGraphics.wl b/Prototypes/GeoGraphics.wl index 2b9fde6..04e6cb7 100644 --- a/Prototypes/GeoGraphics.wl +++ b/Prototypes/GeoGraphics.wl @@ -1,3 +1,11 @@ + +LayeredGeoGraphics[primitives_, geoservicelayers_, options___] := Overlay[ + Map[ + GeoGraphics[primitives, options, GeoServer -> GeoService[#]] &, + geoservicelayers] + ] + + GeoService = <| "OpenStreetMap" :> RandomChoice[{ "http://a.tile.openstreetmap.org/`1`/`2`/`3`.png", @@ -75,7 +83,7 @@ GeoService = <| "http://b.tiles.openrailwaymap.org/signals/`1`/`2`/`3`.png", "http://c.tiles.openrailwaymap.org/signals/`1`/`2`/`3`.png" }], - {"ArcGIS","UnitedStatesTopographical"} -> "https://server.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer/tile/`1`/`3`/`2`" + {"ArcGIS","UnitedStatesTopographical"} -> "https://server.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer/tile/`1`/`3`/`2`" |>; GeoService["Properties"] = Keys[GeoService]; diff --git a/Prototypes/PacletInfo.m b/Prototypes/PacletInfo.m index a37c961..513cbf6 100644 --- a/Prototypes/PacletInfo.m +++ b/Prototypes/PacletInfo.m @@ -53,8 +53,8 @@ "Prototypes`$FormatToExtension", "Prototypes`$InputDirectoryName", "Prototypes`$LocalAppDataDirectory", "Prototypes`$LocalResourceObjects", -"Prototypes`$RoamingAppDataDirectory", -"Prototypes`$UUIDStringPattern"}, +"Prototypes`$RoamingAppDataDirectory", +"Prototypes`$UUIDStringPattern", "Prototypes`LayeredGeoGraphics"}, Context -> {"Prototypes`"} } } ] diff --git a/Prototypes/Usage.wl b/Prototypes/Usage.wl index e7f1493..d3b0d25 100644 --- a/Prototypes/Usage.wl +++ b/Prototypes/Usage.wl @@ -103,4 +103,5 @@ FileTranslate::usage = "FileTranslate[file,lang] translates 'file' to the specif TranslationCell::usage = "TranslationCell[text,lang] prints a \"Text\" cell containing 'text' with an attached button which lets you toggle between English and language 'lang'"; (* geographics *) GeoService::usage = "GeoService[name] provides GeoServer 'name' for geographical functions. Use GeoService[\"Properties\"] for a list. Use with GeoServer option."; +LayeredGeoGraphics::usage = "LayeredGeoGraphics[primitives,layers] creates a layered GeoGraphics map for the specified GeoService layers"; FormatDetect::usage = "FormatDetect[format,data] checks if 'data' (String/List/ByteArray) matches 'format' (PNG/JPG/GIF)";