Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- createMap(pyrmont)
- CurrentPositionMarker(pyrmont);
- map = new google.maps.Map(document.getElementById('map'), {
- center: pyrmont,
- zoom: 16
- });
- document.getElementById('getCafeLocation').onclick = function () {
- nearbySearchCafe(pyrmont)
- }
- let placename = place.name;
- // 吹き出しにカフェの名前を埋め込む
- let contentString = `<div class="sample"><p id="place_name">${placename}</p></div>`;
- // 吹き出し
- let infoWindow = new google.maps.InfoWindow({ // 吹き出しの追加
- content: contentString // 吹き出しに表示する内容
- });
- marker.addListener('click', function () { // マーカーをクリックしたとき
- infoWindow.open(map, marker); // 吹き出しの表示
- });
- function callback(results, status) {
- if (status == google.maps.places.PlacesServiceStatus.OK) {
- for (let i = 0; i < results.length; i++) {
- place = results[i];
- let latlng = place.geometry.location;
- let icn = place.icon;
- placeId = place.place_id;
- createMarker(latlng, icn, place);
- getDetails();
- };
- };
- };
Add Comment
Please, Sign In to add comment