{"id":25759671,"url":"https://github.com/maechabin/jquery.cb-getmaps.js","last_synced_at":"2026-06-10T04:31:41.052Z","repository":{"id":24368545,"uuid":"27767731","full_name":"maechabin/jquery.cb-getmaps.js","owner":"maechabin","description":"Google Maps Apiを使って地図を表示させるjQueryプラグイン","archived":false,"fork":false,"pushed_at":"2015-03-18T11:33:23.000Z","size":188,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-26T17:44:17.913Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://mae.chab.in/archives/2457","language":"JavaScript","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/maechabin.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}},"created_at":"2014-12-09T13:27:47.000Z","updated_at":"2015-07-19T18:15:47.000Z","dependencies_parsed_at":"2022-06-30T00:30:29.942Z","dependency_job_id":null,"html_url":"https://github.com/maechabin/jquery.cb-getmaps.js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maechabin/jquery.cb-getmaps.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maechabin%2Fjquery.cb-getmaps.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maechabin%2Fjquery.cb-getmaps.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maechabin%2Fjquery.cb-getmaps.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maechabin%2Fjquery.cb-getmaps.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maechabin","download_url":"https://codeload.github.com/maechabin/jquery.cb-getmaps.js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maechabin%2Fjquery.cb-getmaps.js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34137570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-02-26T17:37:46.770Z","updated_at":"2026-06-10T04:31:41.038Z","avatar_url":"https://github.com/maechabin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jQuery.cb-getmaps.js\n\n##＜概要＞\n\n「住所」「場所名」「緯度経度」から位置情報を取得し、Google Maps APIを使って地図を表示させるjQueryプラグイン\n\n\n##＜実装方法＞\n\n###1. 外部ファイルを読み込む\njQuery、Google Maps JavaScript API、当プラグインをページに読み込みます。\n```html\n\u003cscript src=\"//code.jquery.com/jquery-1.11.0.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"//maps.googleapis.com/maps/api/js?sensor=true\"\u003e\u003c/script\u003e\n\u003cscript src=\"jquery.cbgetmaps.min.js\"\u003e\u003c/script\u003e\n```\n\n※Google Maps APIの読み込み方については、以下も併せてご確認ください。\n\n[Google Maps JavaScript API v3スタートガイド](https://developers.google.com/maps/documentation/javascript/tutorial?hl=ja)\n\n###2. 位置情報を取得する\n\n「class=\"cb-getlocation\"」を指定した要素のtitle属性に、「住所」、「場所」、「緯度,経度」情報を設定\n\n####ex.1 住所を入力\n```html\n\u003ca href=\"#\" class=\"cb-getlocation\" title=\"東京都新宿区西新宿２−８−１\"\u003e東京都庁\u003c/a\u003e\u003c/p\u003e\n```\n\n####ex.2 場所を入力\n```html\n\u003cp class=\"cb-getlocation\" title=\"東京都庁\"\u003e東京都庁\u003c/p\u003e\n```\n\n####ex.3 [緯度,経度]を入力\n```html\n\u003cp class=\"cb-getlocation\" title=\"35.689599,139.692090\"\u003e東京都庁\u003c/p\u003e\n```\n\n※緯度経度情報はGooleマップの任意の場所で右クリックし、「ここの場所について」を選択すると表示されます。\n\n\n\n###3. 地図を表示する\n\n地図を表示したい要素に「class=\"cb-mapcanvas\"」を指定\n\n####ex.1\n```html\n\u003cdiv class=\"cb-mapcanvas\"\u003e\u003c/div\u003e\n```\n\n####ex.2 取得と表示を同じ要素内で行ってもOK\n```html\n\u003cdiv class=\"cb-getmap cb-mapcanvas\" title=\"35.689599,139.692090\"\u003e\u003c/div\u003e\n```\n\n###4. 2と3をグループ化する\n\n位置情報の取得用の要素と地図表示用の要素をグループ化し、プラグインを実行するためのセレクター（ここでは「class=\"cb-getmap\"」）を設定\n\n####ex.1 基本スタイル\n```html\n\u003cdiv class=\"cb-getmap\"\u003e\n\t\u003cp\u003e\u003ca href=\"#\" class=\"cb-getlocation\" title=\"東京都新宿区西新宿２−８−１\"\u003e東京都庁\u003c/a\u003e\u003c/p\u003e\n\t\u003cdiv class=\"cb-mapcanvas\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n```\n\n####ex.2 取得と表示を同じ要素内で行った場合\n```html\n\u003cdiv class=\"cb-getmap\"\u003e\n\t\u003cdiv class=\"cb-getlocation cb-mapcanvas\" title=\"35.689599,139.692090\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n```\n\n###5. プラグインを実行する\n\n位置情報を取得するclass属性cb−getmapを指定した要素のjQueryオプジェクトに対し、cbGetMapsメソッドを指定\n\n```html\n\u003cscript\u003e\n$(\".cb-getmap\").cbGetMaps();\n\u003c/script\u003e\n```\n\n####オプション\n\nオプションの指定の仕方は以下の通り\n\n```js\n$(\".cb-getmap\").cbGetMaps({\n\tmap_location_name: \".cb-getlocation\",\n\tmap_canvas_name: \".cb-mapcanvas\",\n\tmap_canvas_width: \"100%\",\n\tmap_canvas_height: \"120px\",\n\tmap_canvas_text: \"大きな地図で見る\", // タグ使用可\n\tmap_canvas_text_size: \"14px\",\n\tmap_zoom: 13,\n\tmap_type: \"ROADMAP\" // ROADMAP, SATELLITE, HYBRID, TERRAIN\n});\n```\n\n#####オプションの説明\n\u003cdl\u003e\n\t\u003cdt\u003emap_location_name\u003c/dt\u003e\n\t\u003cdd\u003e位置情報を取得するためのtitle属性を指定する要素のClass属性値\u003c/dd\u003e\n\t\u003cdt\u003emap_canvas_name\u003c/dt\u003e\n\t\u003cdd\u003e地図を表示させる要素のClass属性値\u003c/dd\u003e\n\t\u003cdt\u003emap_canvas_width\u003c/dt\u003e\n\t\u003cdd\u003e表示させる地図の幅\u003c/dd\u003e\n\t\u003cdt\u003emap_canvas_height\u003c/dt\u003e\n\t\u003cdd\u003e表示させる地図の高さ\u003c/dd\u003e\n\t\u003cdt\u003emap_canvas_text\u003c/dt\u003e\n\t\u003cdd\u003e地図の下に表示されるGooleマップへのリンクのアンカーテキスト\u003c/dd\u003e\n\t\u003cdt\u003emap_canvas_text_size\u003c/dt\u003e\n\t\u003cdd\u003e地図の下に表示されるGooleマップへのリンクのアンカーテキストのサイズ\u003c/dd\u003e\n\t\u003cdt\u003emap_zoom\u003c/dt\u003e\n\t\u003cdd\u003e表示される地図の縮尺\u003c/dd\u003e\n\t\u003cdt\u003emap_type\u003c/dt\u003e\n\t\u003cdd\u003e表示される地図のタイプ [ROADMAP], [SATELLITE], [HYBRID], [TERRAIN]\u003c/dd\u003e\n\u003c/dl\u003e\n\n\n##＜デモ＞\n\n[http://jsrun.it/maechabin/TLmG](http://jsrun.it/maechabin/TLmG)\n\n\n##＜ライセンス＞\n\nMIT license\n\n##＜アップデート情報＞\n\n###ver. 1.2\n\n- 同一ページ内で複数の別要素に対してプラグインを実行できるようにしました。\n- これによりそれぞれの要素にオプションを指定することができるようにしました。\n- 位置情報を取得するためのtitle属性を指定する要素を、任意のclass属性値からcb-getlocationに固定しました。\n- 位置情報を取得するためのtitle属性を指定する要素のclass属性値をオプションで指定できるようにしました。\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaechabin%2Fjquery.cb-getmaps.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaechabin%2Fjquery.cb-getmaps.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaechabin%2Fjquery.cb-getmaps.js/lists"}