mirror of
https://github.com/imjasonh/staticmaps
synced 2026-07-08 19:05:09 +00:00
remove *Location and add test
This commit is contained in:
parent
fbc80b3a45
commit
d4ffbe16cc
2 changed files with 4 additions and 3 deletions
|
|
@ -25,6 +25,7 @@ func TestStaticMap(t *testing.T) {
|
|||
c := NewClient("")
|
||||
s := Size{512, 512}
|
||||
opts := &StaticMapOpts{
|
||||
Center: LatLng{-5, -5},
|
||||
Markers: []Markers{
|
||||
{
|
||||
Size: "small",
|
||||
|
|
@ -65,7 +66,7 @@ func TestStaticMap(t *testing.T) {
|
|||
Feature: "water",
|
||||
Element: "geometry.fill",
|
||||
Rules: []StyleRule{
|
||||
{Hue: "0xFF0000"},
|
||||
{Hue: "0x0000FF"},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ func (s Size) String() string {
|
|||
}
|
||||
|
||||
type StaticMapOpts struct {
|
||||
Center *Location
|
||||
Center Location
|
||||
Zoom, Scale int
|
||||
Format, MapType, Language, Region string
|
||||
Markers []Markers
|
||||
|
|
@ -180,7 +180,7 @@ func (so *StaticMapOpts) update(p url.Values) {
|
|||
return
|
||||
}
|
||||
if so.Center != nil {
|
||||
p.Set("center", (*so.Center).Location())
|
||||
p.Set("center", so.Center.Location())
|
||||
}
|
||||
if so.Zoom != 0 {
|
||||
p.Set("zoom", fmt.Sprintf("%d", so.Zoom))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue