๋ฌธ์ ์ค๋ช
์ด ํํ ๋ฆฌ์ผ(Google Maps API ๋ฌธ์)[https://developers.google.com/maps/documentation/javascript/examples/places-searchbox]์์ ๋ณผ ์ ์๋ ๊ฒ์ฒ๋ผ ์ง๋์ ๊ฒ์์ฐฝ์ ์ฝ์
ํ์ฌ ์ฃผ์๋ฅผ ๊ฒ์ํ๊ณ ์์ต๋๋ค.
์ด๋ฅผ ์ํด ์ ๋ NativeMap์ ์ป์๊ณ ๋ค์๊ณผ ๊ฐ์ ๊ฒ์ ์ฌ์ฉํ์ฌ ์ ๋ ฅ ์์๋ฅผ ๋งต์ ํธ์ํ์ต๋๋ค.
this.gmaps.getNativeMap().then(map => {
let input = document.getElementById('my-search-box');
let searchBox = new google.maps.places.SearchBox(input);
map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);
searchBox.addListener('places_changed', () => this.placesChanged(searchBox));
});
controls
๊ฐ ์ง๋์์ ๋ฐํ๋ ๊ฐ์ฒด์ ๋งคํ๋์ง ์๊ธฐ ๋๋ฌธ์ ํญ์ ์ค๋ฅ ๋ฉ์์ง๊ฐ ๋ํ๋ฉ๋๋ค.
'GoogleMap' ์ ํ์ 'controls' ์์ฑ์ด ์์ต๋๋ค.
๊ทธ๋ฌ๋ ์ด์จ๋ ์๋ํฉ๋๋ค.
controls ์์ฑ์ ์ฌ์ฉํ๋ฉด nativeMap์ ์ป์ ํ์ ๋ฉ์ง ์์ ์ ์ํํ ์ ์์ผ๋ฏ๋ก ๊ตฌํํ๋ฉด ํฅํ ๋ฆด๋ฆฌ์ค์ ์ ์ฉํ ์ ์๋ค๊ณ ์๊ฐํฉ๋๋ค.
angular2 ๋ฐ angular2-google-maps ๋ฒ์
angular2 - 2.0.0-rc.6
angular2-google-maps 0.14.0
์ด ๋ฌธ์ ์ ๋ํ ์ ๋ฐ์ดํธ๊ฐ ์์ต๋๊น?
btw, ๋ ธ๊ณ ์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค!
๊ตฌํํ๋ฉด ์ ๋ง ์ข์ ๊ฒ ๊ฐ์์ :)
์ด ๋ฌธ์ ๋ ์ต๊ทผ ํ๋์ด ์์๊ธฐ ๋๋ฌธ์ ์๋์ผ๋ก ์ค๋๋ ๊ฒ์ผ๋ก ํ์๋์์ต๋๋ค. ๋ ์ด์ ํ๋์ด ์์ผ๋ฉด ํ์๋ฉ๋๋ค. ๊ทํ์ ๊ธฐ์ฌ์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๊ตฌํํ๋ฉด ์ ๋ง ์ข์ ๊ฒ ๊ฐ์์ :)