Wiki
Clone wikigetmap / Home
getmap.sty
The goal of this package is the simplest possible provision of map images
(OpenStreetMap, Google Maps and Google Street View are supported). In the simplest case,
the specification of an address is sufficient. The package loads the map
using the \write18
feature, which you must activate to use this package.
The image will be downloaded by an external Lua script.
\getmap[options]{address}
With the \getmap
command you can download a map, if you enable \write18
(TeXLive: -shell-escape
, MiKTeX: --enable-write18
). This is only necessary
if you actually download an image. You can use options to
specify the properties of the downloaded image. After executing the command,
the image is available in the current working directory!
In the simplest case, you only need an address, a POI or geographic coordinates
(latitude,longitude) to download the map. {address} must be fully
expanded and must not contain macros! By default, the image is saved under
the name getmap.png
! If you need only one map (e.g. the office of Dante e.V.)
in your document, it can be as simple as:
#!latex \getmap{Bergheimer Straße 110A, 69115 Heidelberg, Germany} \includegraphics[width=9cm]{getmap}
For a more detailed description of this command and the possible options, take a look into the documentation
More examples
The same map as before from Google Maps:
#!latex \getmap[file=dantegm,mode=gm]{Bergheimer Straße 110A, 69115 Heidelberg, Germany} \includegraphics[width=9cm]{dantegm}
The same map as satellite image:
#!latex \getmap[file=dantegmsat,mode=gm,type=satellite]{Bergheimer Straße 110A, 69115 Heidelberg, Germany} \includegraphics[width=9cm]{dantegmsat}
L’afrique, mon amour!
#!latex \getmap[file=africa,mode=gm,type=terrain,xsize=500,ysize=500, scale=2,zoom=3]{0,16} \includegraphics[width=9cm]{africa}
L’amour, ...
#!latex \getmap[file=paris,mode=gm,type=hybrid,xsize=500,ysize=300, scale=2,zoom=16]{Tour Eiffel, Paris} \includegraphics[width=9cm]{paris}
Street View now:
#!latex \getmap[file=parisgsv,mode=gsv,heading=320,pitch=30,fov=40,xsize=300,ysize=600]{Avenue Piere-Loti, Paris} \includegraphics[width=4cm]{parisgsv}
View from Olympic Tower Munich (Olympic Stadium and Park):
#!latex \getmap[file=mucoly,mode=gsv,heading=260,pitch=-40,fov=90]{Olympiaturm} \includegraphics[width=8cm]{mucoly}
more markers:
#!latex \getmap[ file=bmus1, mode=gm, markers={&markers=size:mid|label:B|color:green|52.521847,13.394398% &markers=label:P|color:green|Pergamonmuseum, Berlin% &markers=label:N|color:blue|52.520063,13.397525}% ]{} \includegraphics[width=10cm]{bmus1}
make some locations visible
#!latex \getmap[ file=bmus2, mode=gm markers={&markers=size:mid|label:B|color:green|52.521847,13.394398% &markers=label:P|color:green|Pergamonmuseum, Berlin% &markers=label:N|color:blue|52.520063,13.397525},% visible={Brandenburger Tor, Berlin|Reichstagsufer 1, Berlin}]{} \includegraphics[width=10cm]{bmus2}
add some pathes:
#!latex \getmap[file=bmus3, mode=gm, language=de, markers={&markers=size:mid|label:B|color:green|52.521847,13.394398% &markers=label:P|color:green|Pergamonmuseum, Berlin% &markers=label:N|color:blue|52.520063,13.397525},% path={&path=weight:5|color:orange|52.521847,13.394398|% Pergamonmuseum, Berlin|52.520063,13.397525|% James-Simon-Park,Berlin|52.522649,13.402523% &path=weight:5|color:purple|James-Simon-Park, Berlin|% Weinmeisterstraße 6, Berlin}]{} \includegraphics[width=10cm]{bmus3}
Routes with encoded polylines:
#!latex \begin{filecontents*}{muc.epl} &path=weight:5|color:orange|enc:okydHa}peAXOHi@jANv@A@kJJmFAiDJuAHmDXcBb@cC`@gC^_DV}CJaCF{APaBVkBdAyEf@qC`@{B\aDSwB \end{filecontents*} \getmap[file=muc, mode=gm, markers={&markers=size:mid|label:H|color:green|München, Hbf &markers=label:S|color:yellow|Stachus, München &markers=label:M|color:blue|Marienplatz, München}, pathfile={muc.epl}]{} \includegraphics[width=10cm]{muc}
fillcolor example:
#!latex \getmap[file=cpny, mode=gm, zoom=13, path={&path=weight:2|color:orange|fillcolor:0xff641A55| 40.764302, -73.973004|40.768044, -73.981903|% 40.800642, -73.958193|40.796887, -73.949226|% 40.764302, -73.973004}]{Central Park, New York} \includegraphics[width=10cm]{cpny}
Updated