{"id":21471347,"url":"https://github.com/waichungwong/jw-google-map","last_synced_at":"2025-03-17T06:47:02.493Z","repository":{"id":57287636,"uuid":"142020519","full_name":"WaiChungWong/jw-google-map","owner":"WaiChungWong","description":"A lightweight react component for google maps.","archived":false,"fork":false,"pushed_at":"2019-02-15T09:40:16.000Z","size":797,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-25T14:55:48.950Z","etag":null,"topics":["google-maps","npm-module","react"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WaiChungWong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-23T13:46:59.000Z","updated_at":"2019-08-19T11:58:13.000Z","dependencies_parsed_at":"2022-08-29T07:01:32.672Z","dependency_job_id":null,"html_url":"https://github.com/WaiChungWong/jw-google-map","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WaiChungWong%2Fjw-google-map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WaiChungWong%2Fjw-google-map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WaiChungWong%2Fjw-google-map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WaiChungWong%2Fjw-google-map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WaiChungWong","download_url":"https://codeload.github.com/WaiChungWong/jw-google-map/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243988961,"owners_count":20379649,"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":["google-maps","npm-module","react"],"created_at":"2024-11-23T09:33:53.923Z","updated_at":"2025-03-17T06:47:02.461Z","avatar_url":"https://github.com/WaiChungWong.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jw-google-map\n\nA react component for google map.\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![node version][node-image]][node-url]\n[![npm download][download-image]][download-url]\n\n[npm-image]: http://img.shields.io/npm/v/jw-google-map.svg\n[npm-url]: http://npmjs.org/package/jw-google-map\n[travis-image]: https://img.shields.io/travis/WaiChungWong/jw-google-map.svg\n[travis-url]: https://travis-ci.org/WaiChungWong/jw-google-map\n[node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg\n[node-url]: http://nodejs.org/download/\n[download-image]: https://img.shields.io/npm/dm/jw-google-map.svg\n[download-url]: https://npmjs.org/package/jw-google-map\n\n[Demo](http://waichungwong.github.io/jw-google-map/build)\n\n## Install\n\n[![NPM](https://nodei.co/npm/jw-google-map.png)](https://nodei.co/npm/jw-google-map)\n\n## Static Methods\n\n| Method      | Parameters     | Description                                                   |\n| ----------- | -------------- | ------------------------------------------------------------- |\n| `setAPIKey` | `api`: string. | set the API key for google map and reload the Map API script. |\n\n## Methods\n\n| Method         | Parameters                                                          | Description                                              |\n| -------------- | ------------------------------------------------------------------- | -------------------------------------------------------- |\n| `getMapCenter` |                                                                     | retrieve the lat and long of the center of the map view. |\n| `setMarker`    | `position`: object consist of\u003cbr/\u003e{ `lat`: number, `lng`: number }. | set a marker on a given position of map.                 |\n\n## Props\n\n| Prop               | Description                                                  |\n| ------------------ | ------------------------------------------------------------ |\n| `center`(optional) | the initial center of the map. Default: `{ lat: 0, lng: 0 }` |\n| `zoom`(optional)   | the initial zoom of the map. Default: `0`                    |\n\n## Usage\n\n```javascript\nimport React, { Component } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport Map, { setAPIKey } from \"jw-google-map\";\n\nimport \"./style.css\";\n\nclass Demo extends Component {\n  conponentDidMount() {\n    setAPIKey(`\u003cAPI KEY HERE\u003e`);\n\n    const { map } = this;\n\n    const position = map.getMapCenter();\n\n    map.setMarker(position);\n  }\n\n  render() {\n    return \u003cMap ref={m =\u003e (this.map = m)} /\u003e;\n  }\n}\n\nReactDOM.render(\u003cDemo /\u003e, document.getElementById(\"root\"));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaichungwong%2Fjw-google-map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaichungwong%2Fjw-google-map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaichungwong%2Fjw-google-map/lists"}