GPS

class visigoth.map_layers.gps.GPS(radius=20, fill='#FF000030', stroke='black', stroke_width=2)

Create a plot showing the user location (if known) with a pulsating circle

Arguments:

Keyword Arguments:
 
  • radius (int) – radius of circle in pixels
  • fill (str) – fill colour
  • stroke (str) – stroke color for circumference of circles
  • stroke_width (int) – stroke width for circumference of circles

Notes:

Example

(Link to open example in new tab):

Source Code (Link to Github):

# -*- coding: utf-8 -*-

from visigoth.diagram import Diagram
from visigoth.containers import Map, Box
from visigoth.map_layers import WMS, GPS
from visigoth.utils.mapping import Projections
from visigoth.common import Text

d = Diagram()

bounds  = ((-180,-70),(180,70))
m = Map(512,bounds,projection=Projections.ESPG_3857,zoom_to=4)
g = GPS()
m.addLayer(WMS())
m.addLayer(g)
d.add(Box(Text("GPS Test",text_attributes={"font-style":"italic"})))
d.add(Box(m))

html = d.draw(format="html")

f = open("example.html", "w")
f.write(html)
f.close()