{"id":22599567,"url":"https://github.com/alexcheng1982/gaode-static-map","last_synced_at":"2025-03-28T19:47:05.205Z","repository":{"id":229780935,"uuid":"777608915","full_name":"alexcheng1982/gaode-static-map","owner":"alexcheng1982","description":"Gaode Static Map URL Generator","archived":false,"fork":false,"pushed_at":"2024-04-15T09:03:31.000Z","size":34,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-17T02:01:09.867Z","etag":null,"topics":["gaode","gaodemap","map"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexcheng1982.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"ko_fi":"alexcheng1982","github":"alexcheng1982"}},"created_at":"2024-03-26T07:12:06.000Z","updated_at":"2024-03-27T10:05:35.000Z","dependencies_parsed_at":"2024-04-11T10:24:25.145Z","dependency_job_id":"76ea5dc9-1104-4bba-aa56-dc9f44767b23","html_url":"https://github.com/alexcheng1982/gaode-static-map","commit_stats":null,"previous_names":["alexcheng1982/gaode-static-map"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexcheng1982%2Fgaode-static-map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexcheng1982%2Fgaode-static-map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexcheng1982%2Fgaode-static-map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexcheng1982%2Fgaode-static-map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexcheng1982","download_url":"https://codeload.github.com/alexcheng1982/gaode-static-map/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246093100,"owners_count":20722395,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gaode","gaodemap","map"],"created_at":"2024-12-08T11:10:05.023Z","updated_at":"2025-03-28T19:47:05.182Z","avatar_url":"https://github.com/alexcheng1982.png","language":"Java","funding_links":["https://ko-fi.com/alexcheng1982","https://github.com/sponsors/alexcheng1982"],"categories":[],"sub_categories":[],"readme":"# Gaode Static Map URL Generator (高德静态地图URL生成器)\n\n[![build](https://github.com/alexcheng1982/gaode-static-map/actions/workflows/build.yaml/badge.svg)](https://github.com/alexcheng1982/gaode-static-map/actions/workflows/build.yaml)\n[![Maven Central Version](https://img.shields.io/maven-central/v/io.github.alexcheng1982/gaode-static-map)](https://central.sonatype.com/artifact/io.github.alexcheng1982/gaode-static-map)\n\nGenerate URL\nfor [Gaode Static Maps](https://developer.amap.com/api/webservice/guide/api/staticmaps/).\n生成高德地图的静态地图的URL.\n\nRequires Java 8.\n\nA [Gaode API key](https://lbs.amap.com/api/webservice/create-project-and-key) is\nrequired to render the map.\n\nAdd the\nfollowing [Maven dependency](https://central.sonatype.com/artifact/io.github.alexcheng1982/gaode-static-map)\nto your project.\n\n```xml\n\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.github.alexcheng1982\u003c/groupId\u003e\n  \u003cartifactId\u003egaode-static-map\u003c/artifactId\u003e\n  \u003cversion\u003e1.2.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nBuild a `StaticMap` and pass to `StaticMapGenerator.generate()` to generate the\nURL.\n\n```java\nGeoLocation center = GeoLocation.builder()\n    .lat(39.990464)\n    .lng(116.481485)\n    .build();\nGeoLocation p1 = GeoLocation.builder()\n    .lat(40)\n    .lng(116.5)\n    .build();\nGeoLocation p2 = GeoLocation.builder()\n    .lat(40.05)\n    .lng(116.8)\n    .build();\nStaticMap map = StaticMap.builder()\n    .key(\"demo\")\n    .location(center)\n    .zoom(10)\n    .markers(Markers.builder()\n        .markersGroups(Arrays.asList(\n            MarkersGroup.builder()\n                .style(MarkerStyle.builder()\n                    .size(MarkerSize.LARGE)\n                    .label(\"A\")\n                    .build())\n                .locations(Arrays.asList(center))\n                .build()\n        ))\n        .build())\n    .labels(Labels.builder()\n        .labelsGroups(Arrays.asList(\n            LabelsGroup.builder()\n                .style(LabelStyle.builder()\n                    .content(\"Test\")\n                    .fontSize(16)\n                    .build())\n                .locations(Arrays.asList(center))\n                .build()\n        ))\n        .build())\n    .paths(Paths.builder()\n        .pathsGroups(Arrays.asList(\n            PathsGroup.builder()\n                .locations(Arrays.asList(\n                    center, p1, p2\n                ))\n                .build()\n        ))\n        .build())\n    .build();\nString url = StaticMapGenerator.generate(map);\n```\n\nThe output url looks\nlike `https://restapi.amap.com/v3/staticmap?size=400*400\u0026paths=5%2C0x0000FF%2C1.0%2C%2C%3A116.481485%2C39.990464%3B116.5%2C40.0%3B116.8%2C40.05\u0026scale=1\u0026location=116.481485%2C39.990464\u0026zoom=10\u0026markers=large%2C0xFC6054%2CA%3A116.481485%2C39.990464\u0026key=demo\u0026labels=Test%2C0%2C0%2C16%2C0xFFFFFF%2C0x5288d8%3A116.481485%2C39.990464\u0026traffic=0`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexcheng1982%2Fgaode-static-map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexcheng1982%2Fgaode-static-map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexcheng1982%2Fgaode-static-map/lists"}