Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
明日から使えるGoogle maps platform 入門
Search
nekoze
February 26, 2019
350
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
明日から使えるGoogle maps platform 入門
nekoze
February 26, 2019
Transcript
21 slides
໌͔Β͑ΔGOOGLE MAPS PLATFORM ೖ
ࣗݾհ • Ԭ େथ (ͳ͕͓͔ ͍͖ͩ) • 1994ੜ·Ε(24ࡀ) • Twitter:
@nekoze_da • ܦྺ • 1~1.4:ɹɹɹגࣜձ͙ࣾΔͳͼ • 1.5ʙݱࡏ:ɹ JapanTaxiגࣜձࣾ • झຯ • ήʔϜ/μʔπ/ϓϩάϥϛϯά/ಛࡱ/ࣗ࡞ΩʔϘʔυ/ ےτϨ/ϥϯχϯά/Թઘ/ΞΩόࢄࡦ
ࠓͷ͓ ᶃ Google Maps Platformͱ • શମ૾͍ํΛѲ͠Α͏ ᶄ Google Maps
PlatformϋϯζΦϯ • ਤΛWEBαΠτʹදࣔͤ͞Α͏ • Ңܦ͔ΒॅॴΛऔಘ͠Α͏ • Ωʔϫʔυ͔ΒॅॴީิΛऔಘ͠Α͏
GOOGLE MAPS PLATFORMͱ
GOOGLE MAPS PLATFORMͱ • GoogleϚοϓͷػೳΛࣗͷαΠτΞϓϦ࡞ʹ׆༻ Ͱ͖ΔΑ͏ʹͨ͠API • ࡢ6݄·Ͱچ໊শGoogleMapAPI • ୯७Խ͞ΕɺϢʔβʔʹͱͬͯΘ͔Γ͍༷͢ʹ
Ξοϓσʔτ͞Εͨ • ݄200υϧ·ͰແྉͰར༻Մೳ
APIͷछྨ • Map API • Routes API • Place API
MAP API • Google MapͷਤΛදࣔ͢ΔͨΊͷAPI • Javascript • iOS SDK
• Android SDK • etc... • ਤͷελΠϧɺϚʔΧʔɺϥΠϯɺը૾·ͰৄࡉʹΧελϚΠ ζՄೳ
ROUTES API • A~B·Ͱͷಓ࿏্ͷܦ࿏ɺҠಈ࣌ؒ Λऔಘ͢ΔAPI
PLACE API • ॴʹؔ͢ΔৄࡉσʔλΛ׆༻ͨ͠API • ॴৄࡉ • ॴݕࡧ • ΦʔτίϯϓϦʔτ
• δΦίʔσΟϯά • Ґஔใऔಘ • λΠϜκʔϯ • etc...
GOOGLE MAPS PLATFORM Λ׆༻ͨ͠αʔϏεҰཡ Uber Ecbo Cloak pokemon GO JapanTaxi
GOOGLE MAPS PLATFORM ϋϯζΦϯ
• Maps JavaScript APIΛ༻ (υΩϡϝϯτ: https://developers.google.com/maps/documentation/javascript/tutorial) • YOUR_API_KEYʹൃߦͨ͠APIΩʔΛషΓ͚Δ •
callbackύϥϝʔλʹϚοϓͷઃఆΛఆ໊ٛͨؔ͠Λೖྗ͢Δ ਤΛදࣔ͢Δ
ਤΛදࣔ͢Δ • new google.maps.Map(ϚοϓΛද͍ࣔͤͨ͞ཁૉ, Φϓγϣϯ)ͰਤΛදࣔ • centerΦϓγϣϯ: ॳظදࣔ࣌Ͱਤதԝʹද͍ࣔͤͨ͞ͷҢܦ • zoomΦϓγϣϯ:
ॳظදࣔͷਤͷζʔϜϨϕϧ͕େ͖͘ͳΔ΄Ͳ֦େ͞ΕΔ • ͦͷଞΦϓγϣϯυΩϡϝϯτΛ֬ೝ
ϚʔΧʔΛදࣔ͢Δ • new google.maps.Marker(Φϓγϣϯ(object))ͰϚʔΧʔΛදࣔ • position: ϚʔΧʔΛग़ݱ͍ͤͨ͞Ңܦ ྫ: { lat:
35.681236, lng: 139.767125 } • map: ϚʔΧʔΛग़ݱ͍ͤͨ͞ରͷmap • ͦͷଞΦϓγϣϯυΩϡϝϯτΛ֬ೝ
Ңܦ͔ΒॅॴใΛऔಘ͢Δ • Geocoding APIΛ༻ • ύϥϝʔλ • latlng: Ң, ܦ
• language: දࣔݴޠ • key: APIΩʔ curl -X GET 'https: //maps.googleapis.com/maps/api/geocode/json? latlng=35.681236,139.767125&language=ja&key=AIzaSyACJ066_Ge7arr_5qQMdDthr 7p_k9eFeRA'
Ωʔϫʔυ͔ΒॅॴใͷީิΛ औಘ͢Δ • Place Autocomplete APIΛ༻ • ύϥϝʔλ • input:
Ң, ܦ • location: ݕࡧͷىͱͳΔҢ,ܦ • radius: location͔Βͷݕࡧൣғ(ϝʔτϧ) • language: දࣔݴޠ • key: APIΩʔ curl -X GET ‘https: //maps.googleapis.com/maps/api/place/autocomplete/json? input=౦ژυʔϜ &location=35.681236,139.767125&radius=5000&language=ja&key=AIzaSyACJ066_Ge7 arr_5qQMdDthr7p_k9eFeRA'
ࠓճͭ͘Δͷ • ਤΛදࣔ͢Δ(Maps JavaScript API) • ϚʔΧʔΛදࣔ͢Δ(Maps JavaScript API) •
ϚʔΧʔʹஔͨ͠ॴͷॅॴใ͕දࣔ ͞ΕΔ(Geocoding API) • ݕࡧ૭ʹΩʔϫʔυΛೖྗ͢Δͱॅॴީิ ͕දࣔ͞ΕΔ (Place Autocomplete API) ϦϑΝϨϯεURL: https://developers.google.com/maps/ documentation/javascript/reference/
ϓϩδΣΫτͷ४උ git clone https://github.com/nekoze1210/GoogleMapsPlatform_SampleApp.git Terminal cd GoogleMapsPlatform_SampleApp docker-compose build docker-compose
run web rails db:create docker-compose up -d dockerΛ༻͢Δ߹ open http://localhost:3000
ϓϩδΣΫτͷ४උ git clone https://github.com/nekoze1210/GoogleMapsPlatform_SampleApp.git Terminal cd GoogleMapsPlatform_SampleApp bundle install bundle
exec rails s bundle exec rails db:create dockerΛ༻͠ͳ͍߹(Ruby: 2.6.1) open http://localhost:3000 ./config/database.ymlΛฤू(username, password, hostΛมߋ)
API KEYͷઃఆ GOOGLE_MAPS_KEY=औಘͨ͠GoogleMapsPlatformͷAPIKey .env
ࠂ • 4/14() ٕज़ॻయ6ʹͯGoogleMapsPlatformೖ ͷٕज़ॻΛ൦͠·͢ʂ ஔॴ ͖13
More Decks by nekoze
See All by nekoze
【新卒2年目で転職】 1ヶ月前に試用期間を終えて感じたこと
nekoze1210
1
330
Featured
See All Featured
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.5k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
450
Site-Speed That Sticks
csswizardry
13
1.6k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
630
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
490
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
330
The Cult of Friendly URLs
andyhume
79
7.1k
Rails Girls Zürich Keynote
gr2m
96
14k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.4k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
6
940