The same one-call translation hook the IGN kind got, chained after it, and the /tiles/ marker joins the URL segments a tile record's layer can be recovered from.
- commit
- 85036ba78239ccaf042a4e99f0ed17a3201e87cb
- parent
- 22bce7439944b1ebd64205a7c33eadf9170b6408
- author
- Dami <dami.etoile@gmail.com>
| M | tools/ | 4 | ++++ |
| M | tools/ | 8 | ++++++-- |
@@ -17,6 +17,7 @@ import (
1717 1818 "github.com/FelineStateMachine/atlas/internal/bundle"1919 "github.com/FelineStateMachine/atlas/internal/ignmap"20+ "github.com/FelineStateMachine/atlas/internal/pbmap"2021 )2122 2223 type archive struct {@@ -479,6 +480,9 @@ func buildMap(
479480 if doc, err = ignmap.MaybeTranslate(latest.Kind, doc); err != nil {480481 return nil, "", err481482 }483+ if doc, err = pbmap.MaybeTranslate(latest.Kind, doc); err != nil {484+ return nil, "", err485+ }482486 var raw rawMap483487 if err := json.Unmarshal(doc, &raw); err != nil {484488 return nil, "", err@@ -27,6 +27,7 @@ import (
2727 _ "golang.org/x/image/webp"2828 2929 "github.com/FelineStateMachine/atlas/internal/ignmap"30+ "github.com/FelineStateMachine/atlas/internal/pbmap"3031 )3132 3233 const (@@ -453,6 +454,9 @@ func inspectMap(mapDir string) ([]tilePlan, string, string, error) {
453454 if doc, err = ignmap.MaybeTranslate(latest.Kind, doc); err != nil {454455 return nil, "", "", err455456 }457+ if doc, err = pbmap.MaybeTranslate(latest.Kind, doc); err != nil {458+ return nil, "", "", err459+ }456460 var raw rawMap457461 if err := json.Unmarshal(doc, &raw); err != nil {458462 return nil, "", "", err@@ -994,9 +998,9 @@ func sourceTilePath(mapDir string, record tileRecord) (string, error) {
994998 995999 // tileSetPath recovers the layer path a record belongs to: everything between9961000 // the source's marker segment and "/<zoom>/". MapGenie serves tiles under997-// /games/, IGN under /wikimaps/.1001+// /games/, IGN under /wikimaps/, Piggyback under /tiles/.9981002 func tileSetPath(rawURL string, zoom int) string {999- for _, marker := range []string{"/games/", "/wikimaps/"} {1003+ for _, marker := range []string{"/games/", "/wikimaps/", "/tiles/"} {10001004 _, rest, found := strings.Cut(rawURL, marker)10011005 if !found {10021006 continue