Skip to content

Instantly share code, notes, and snippets.

@ringsaturn
Last active September 10, 2023 13:56
Show Gist options
  • Save ringsaturn/12b5509d80f69e7bca13da8745f7ce15 to your computer and use it in GitHub Desktop.
Save ringsaturn/12b5509d80f69e7bca13da8745f7ce15 to your computer and use it in GitHub Desktop.
GPT Prompts for tzf-server's clickable debugger, from https://github.com/ringsaturn/tzf-server/pull/99

Please write a web page for me using Leaflet. When I left-click on the map:

  1. Call API /api/v1/tz
    curl "http://localhost:8080/api/v1/tz?lng=116.3883&lat=39.9289"
    Response:
    {
      "timezone": "Asia/Shanghai",
      "abbreviation": "CST",
      "offset": 28800
    }
    Show the timezone&abbreviation&offset returned by the interface as a marker, and the coordinates are the coordinates clicked by the user.
  2. Call API /api/v1/tz/geojson
    curl http://localhost:8080/api/v1/tz/geojson??lng=116.3883&lat=39.9289
    Response:
    {
      "geometry": {
        "coordinates": [
          [
            [
              [12.457, 41.903],
              [12.457, 41.905],
              [12.455, 41.907],
              [12.450, 41.906],
              [12.445, 41.901],
              [12.454, 41.900],
              [12.454, 41.901],
              [12.458, 41.901],
              [12.457, 41.903],
              [12.456, 41.902],
              [12.457, 41.903]
            ]
          ]
        ],
        "type": "MultiPolygon"
      },
      "properties": { "tzid": "Europe/Vatican" },
      "type": "Feature"
    }
    Show the GeoJSON returned by the interface on the map.

Other requirements:

  1. The added Marker left-click pops up detailed information, including timezone&abbreviation&offset
  2. If the added polygon has been added before, please do not add it repeatedly, judge according to tzid

I want a full screen map

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment