{"id":15885752,"url":"https://github.com/skyt-a/svelte-google-maps-api","last_synced_at":"2025-04-02T15:45:05.188Z","repository":{"id":183380287,"uuid":"669133937","full_name":"skyt-a/svelte-google-maps-api","owner":"skyt-a","description":"Google Map JavaScript API Wrapper for Svelte","archived":false,"fork":false,"pushed_at":"2023-07-27T03:33:12.000Z","size":57,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-01T03:46:47.185Z","etag":null,"topics":["google","google-maps","google-maps-api","svelte","svelte4","sveltekit"],"latest_commit_sha":null,"homepage":"","language":"Svelte","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skyt-a.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-07-21T12:27:55.000Z","updated_at":"2023-07-27T00:18:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"a2726af2-0dfb-4d37-8ab9-fe4a27d680a7","html_url":"https://github.com/skyt-a/svelte-google-maps-api","commit_stats":null,"previous_names":["skyt-a/svelte-google-maps-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyt-a%2Fsvelte-google-maps-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyt-a%2Fsvelte-google-maps-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyt-a%2Fsvelte-google-maps-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyt-a%2Fsvelte-google-maps-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skyt-a","download_url":"https://codeload.github.com/skyt-a/svelte-google-maps-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246847053,"owners_count":20843438,"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","google-maps","google-maps-api","svelte","svelte4","sveltekit"],"created_at":"2024-10-06T05:07:20.688Z","updated_at":"2025-04-02T15:45:05.170Z","avatar_url":"https://github.com/skyt-a.png","language":"Svelte","funding_links":[],"categories":[],"sub_categories":[],"readme":"## svelte-google-maps-api\n\n**warning:　This repository is under development**\n\n## Feature\n・Google Map JavaScript API Wrapper for Svelte\u003cbr\u003e\n・Svelte 4 Supported\n\n## Install\n\n```\nnpm install svelte-google-maps-api\n```\n\n## Component\n### LoadScript\n\n`LoadScript` is a Svelte component that handles the loading of Google Maps JavaScript API script.\n\n#### Properties\n\n| Prop       | Type     | Description |\n|------------|----------|-------------|\n| `apiKey`   | `string` | Google Maps API Key |\n| `libraries` | `string[]` | An array of Google Map libraries to be loaded with the script. |\n\n### GoogleMap\n\n`GoogleMap` is a component for rendering a Google Map.\n\n#### Properties\n\n| Prop                    | Type     | Description |\n|-------------------------|----------|-------------|\n| id                    | `string` | An identifier for the map container. |\n| options               | `google.maps.MapOptions` | Google Map options object. |\n| onClick               | `(e: google.maps.MapMouseEvent) =\u003e void`| Callback function that is called when the map is clicked. |\n| onDblClick            | `(e: google.maps.MapMouseEvent) =\u003e void`| Callback function that is called when the map is double clicked. |\n| onDragEnd             | `(e: google.maps.MapMouseEvent) =\u003e void`| Callback function that is called when the drag ends. |\n| onDragStart           | `(e: google.maps.MapMouseEvent) =\u003e void`| Callback function that is called when the drag starts. |\n| onMouseDown           | `(e: google.maps.MapMouseEvent) =\u003e void`| Callback function that is called when the mouse button is pressed. |\n| onMouseMove           | `(e: google.maps.MapMouseEvent) =\u003e void`| Callback function that is called when the mouse pointer moves. |\n| onMouseOut            | `(e: google.maps.MapMouseEvent) =\u003e void`| Callback function that is called when the mouse pointer moves out of the map. |\n| onMouseOver           | `(e: google.maps.MapMouseEvent) =\u003e void`| Callback function that is called when the mouse pointer moves over the map. |\n| onMouseUp             | `(e: google.maps.MapMouseEvent) =\u003e void`| Callback function that is called when the mouse button is released. |\n| onRightClick          | `(e: google.maps.MapMouseEvent) =\u003e void`| Callback function that is called when the map is right clicked. |\n| onDrag                | `(e: google.maps.MapMouseEvent) =\u003e void`| Callback function that is called when the map is dragged. |\n| onCenterChanged       | `(e: google.maps.MapMouseEvent) =\u003e void`| Callback function that is called when the center of the map changes. |\n| onLoad                | `(map: google.maps.Map) =\u003e void`| Callback function that is called when the map is loaded. |\n| onUnmount             | `(map: google.maps.Map) =\u003e void`| Callback function that is called when the map unmounts. |\n| mapContainerStyle     | `string`  | Style for the map container. Default is 'width:100%;height:100%'. |\n| mapContainerClassName | `string`  | Class name for the map container. |\n\n### Usage\n\nThe `GoogleMap` component can be used to render a Google Map:\n\n```svelte\n\u003cscript lang=\"ts\"\u003e\n    \timport LoadScript from 'svelte-google-maps-api/LoadScript.svelte';\n\timport GoogleMap from 'svelte-google-maps-api//GoogleMap.svelte';\n\n\tconst options = {\n\t\tzoom: 4,\n\t\tcenter: {lat: -33, lng: 151},\n\t};\n\n\tconst handleLoad = (map: google.maps.Map) =\u003e {\n\t\t// do something with the loaded map\n\t};\n\u003c/script\u003e\n\n\u003cLoadScript apiKey={yourApiKey}\u003e\n\t\u003cGoogleMap {options} onLoad={handleLoad} /\u003e\n\u003c/LoadScript\u003e\n```\n\n### Marker\n\n#### Properties\n\n| Property            | Type                                                            | Description                                                                                                                                                                                                                                   |\n|---------------------|-----------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| position            | `google.maps.LatLng \\| google.maps.LatLngLiteral`       | Specifies the position of the marker.                                                                                                                                                                                                         |\n| options             | `google.maps.MarkerOptions`                             | An object containing options for the marker, such as its icon, title, etc.                                                                                                                                                                    |\n| onClick             | `((e: google.maps.MapMouseEvent) =\u003e void)`              | Event handler for when the marker is clicked.                                                                                                                                                                                                 |\n| onClickableChanged  | `(() =\u003e void)`                                          | Event handler for when the marker's 'clickable' property is changed.                                                                                                                                                                          |\n| onCursorChanged     | `(() =\u003e void)`                                          | Event handler for when the marker's 'cursor' property is changed.                                                                                                                                                                             |\n| onAnimationChanged  | `(() =\u003e void)`                                          | Event handler for when the marker's 'animation' property is changed.                                                                                                                                                                          |\n| onDblClick          | `((e: google.maps.MapMouseEvent) =\u003e void)`              | Event handler for when the marker is double-clicked.                                                                                                                                                                                          |\n| onDrag              | `((e: google.maps.MapMouseEvent) =\u003e void)`              | Event handler for when the marker is dragged.                                                                                                                                                                                                 |\n| onDragEnd           | `((e: google.maps.MapMouseEvent) =\u003e void)`              | Event handler for when the dragging of the marker ends.                                                                                                                                                                                        |\n| onDraggableChanged  | `(() =\u003e void)`                                          | Event handler for when the marker's 'draggable' property is changed.                                                                                                                                                                          |\n| onDragStart         | `((e: google.maps.MapMouseEvent) =\u003e void)`              | Event handler for when the dragging of the marker starts.                                                                                                                                                                                      |\n| onFlatChanged       | `(() =\u003e void)`                                          | Event handler for when the marker's 'flat' property is changed.                                                                                                                                                                               |\n| onIconChanged       | `(() =\u003e void)`                                          | Event handler for when the marker's 'icon' property is changed.                                                                                                                                                                               |\n| onMouseDown         | `((e: google.maps.MapMouseEvent) =\u003e void)`              | Event handler for when the mouse button is pressed on the marker.                                                                                                                                                                             |\n| onMouseOut          | `((e: google.maps.MapMouseEvent) =\u003e void)`              | Event handler for when the mouse leaves the area of the marker.                                                                                                                                                                               |\n| onMouseOver         | `((e: google.maps.MapMouseEvent) =\u003e void)`              | Event handler for when the mouse enters the area of the marker.                                                                                                                                                                               |\n| onMouseUp           | `((e: google.maps.MapMouseEvent) =\u003e void)`              | Event handler for when the mouse button is released on the marker.                                                                                                                                                                            |\n| onPositionChanged   | `(() =\u003e void)`                                          | Event handler for when the marker's 'position' property is changed.                                                                                                                                                                           |\n| onRightClick        | `((e: google.maps.MapMouseEvent) =\u003e void)`              | Event handler for when the marker is right-clicked.                                                                                                                                                                                           |\n| onShapeChanged      | `(() =\u003e void)`                                          | Event handler for when the marker's 'shape' property is changed.                                                                                                                                                                              |\n| onTitleChanged      | `(() =\u003e void)`                                          | Event handler for when the marker's 'title' property is changed.                                                                                                                                                                              |\n| onVisibleChanged    | `(() =\u003e void)`                                          | Event handler for when the marker's 'visible' property is changed.                                                                                                                                                                            |\n| onZindexChanged     | `(() =\u003e void)`                                          | Event handler for when the marker's 'zIndex' property is changed.                                                                                                                                                                             |\n| onLoad              | `((marker: google.maps.Marker) =\u003e void)`                | Event handler for when the marker is added to the map. This event fires after the marker's position has been changed for the first time, but before the marker's `click` event and the map's `mousemove` and `idle` events.                    |\n| onUnmount           | `((marker: google.maps.Marker) =\u003e void)`                | Event handler for when the marker is removed from the map.                                                                                                                                                                                    |\n\n### Usage\n\n```svelte\n\u003cscript lang=\"ts\"\u003e\n\timport GoogleMap from 'svelte-google-maps-api//GoogleMap.svelte';\n\timport Marker from 'svelte-google-maps-api//Marker.svelte';\n\n\tconst position = {lat: 37.7749, lng: -122.4194};\n\tconst options = {\n\t\tdraggable: true,\n\t\ttitle: \"Hello, World!\"\n\t};\n\u003c/script\u003e\n\n\u003cGoogleMap\u003e\n\t\u003cMarker {position} {options} /\u003e\n\u003c/GoogleMap\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyt-a%2Fsvelte-google-maps-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskyt-a%2Fsvelte-google-maps-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyt-a%2Fsvelte-google-maps-api/lists"}