Skip to content

Commit

Permalink
add LayeredGeoGraphics
Browse files Browse the repository at this point in the history
  • Loading branch information
arnoudbuzing committed May 24, 2018
1 parent 98601a1 commit fecb321
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
10 changes: 9 additions & 1 deletion Prototypes/GeoGraphics.wl
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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];
4 changes: 2 additions & 2 deletions Prototypes/PacletInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
"Prototypes`$FormatToExtension", "Prototypes`$InputDirectoryName",
"Prototypes`$LocalAppDataDirectory",
"Prototypes`$LocalResourceObjects",
"Prototypes`$RoamingAppDataDirectory",
"Prototypes`$UUIDStringPattern"},
"Prototypes`$RoamingAppDataDirectory",
"Prototypes`$UUIDStringPattern", "Prototypes`LayeredGeoGraphics"},
Context -> {"Prototypes`"} }
}
]
1 change: 1 addition & 0 deletions Prototypes/Usage.wl
Original file line number Diff line number Diff line change
Expand Up @@ -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)";

0 comments on commit fecb321

Please sign in to comment.