Skip to content

Commit

Permalink
feature: allow for multi-line attribution strings. Closes #73
Browse files Browse the repository at this point in the history
  • Loading branch information
flopp committed Apr 3, 2024
1 parent 722a1fc commit 034cded
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions examples/multiline-attribution/multiline-attribution.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// This is an example on how to use a multiline attribution string.

package main

import (
sm "github.com/flopp/go-staticmaps"
"github.com/fogleman/gg"
"github.com/golang/geo/s2"
)

func main() {
ctx := sm.NewContext()
ctx.SetSize(400, 300)
ctx.OverrideAttribution("This is a\nmulti-line\nattribution string.")
ctx.SetCenter(s2.LatLngFromDegrees(48, 7.9))
ctx.SetZoom(13)

img, err := ctx.Render()
if err != nil {
panic(err)
}

if err := gg.SavePNG("multiline-attribution.png", img); err != nil {
panic(err)
}
}

0 comments on commit 034cded

Please sign in to comment.