Donghoon Kim

get place information and show to web

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="4fb88dcd-e8f6-48b2-aba2-c7d407514a54" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/public/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/public/index.html" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FUSProjectUsageTrigger">
<session id="-1867001403">
<usages-collector id="statistics.lifecycle.project">
<counts>
<entry key="project.closed" value="1" />
<entry key="project.open.time.4" value="1" />
<entry key="project.opened" value="1" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.open">
<counts>
<entry key="LICENSE" value="1" />
<entry key="html" value="1" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.open">
<counts>
<entry key="HTML" value="1" />
<entry key="PLAIN_TEXT" value="1" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.edit">
<counts>
<entry key="html" value="2" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.edit">
<counts>
<entry key="HTML" value="2" />
</counts>
</usages-collector>
</session>
</component>
<component name="FileEditorManager">
<leaf>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/public/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="619">
<caret line="215" column="18" selection-start-line="215" selection-start-column="18" selection-end-line="215" selection-end-column="18" />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsGulpfileManager">
<detection-done>true</detection-done>
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="ProjectFrameBounds">
<option name="y" value="23" />
<option name="width" value="1120" />
<option name="height" value="1027" />
</component>
<component name="ProjectView">
<navigator currentView="Scope" currentSubView="Scope 'Project Files'; set:Project Files; class com.intellij.psi.search.scope.ProjectFilesScope" proportions="" version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane" />
<pane id="Scope">
<subPane subId="Scope 'Project Files'; set:Project Files; class com.intellij.psi.search.scope.ProjectFilesScope">
<expand>
<path>
<item name="OpenSource_Project" type="3d21c010:ScopeViewTreeModel$ProjectNode" />
<item name="" type="442cc68d:ScopeViewTreeModel$RootNode" />
</path>
<path>
<item name="OpenSource_Project" type="3d21c010:ScopeViewTreeModel$ProjectNode" />
<item name="" type="442cc68d:ScopeViewTreeModel$RootNode" />
<item name="public" type="9f88c78c:ScopeViewTreeModel$FileNode" />
</path>
</expand>
<select />
</subPane>
</pane>
</panes>
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="4fb88dcd-e8f6-48b2-aba2-c7d407514a54" name="Default Changelist" comment="" />
<created>1544527165116</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1544527165116</updated>
<workItem from="1544527168977" duration="145000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="145000" />
</component>
<component name="ToolWindowManager">
<frame x="0" y="23" width="1120" height="1027" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="Favorites" side_tool="true" />
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.24931756" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info anchor="bottom" id="Docker" show_stripe_button="false" />
<window_info anchor="bottom" id="Version Control" />
<window_info anchor="bottom" id="Terminal" />
<window_info anchor="bottom" id="Event Log" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="bottom" id="Run" order="2" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
</layout>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/public/LICENSE">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/public/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="619">
<caret line="215" column="18" selection-start-line="215" selection-start-column="18" selection-end-line="215" selection-end-column="18" />
</state>
</provider>
</entry>
</component>
</project>
\ No newline at end of file
......@@ -42,43 +42,43 @@
<!-- Sidebar -->
<ul class="sidebar navbar-nav">
<li class="nav-item">
<a class="nav-link" href="index.html">
<i class="fas fa-map-marker"></i>
<span>Map</span>
</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="Foods.html">
<i class="fas fa-utensils" area-hidden ="true"></i>
<span>Foods</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="Entertainment.html">
<i class="fas fa-gamepad"></i>
<span>Entertainment</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="Rooms.html">
<i class="fas fa-bed"></i>
<span>Rooms</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="Favorite.html">
<i class="fas fa-heart"></i>
<span>Favorite</span>
</a>
</li>
</ul>
<div id="content-wrapper">
......@@ -187,7 +187,7 @@
<i class="fas fa-angle-up"></i>
</a>
<!-- Bootstrap core JavaScript-->
<script src="vendor/jquery/jquery.min.js"></script>
......
......@@ -24,7 +24,7 @@
padding: 0;
}
</style>
<!-- Bootstrap core CSS-->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
......@@ -49,233 +49,53 @@
<i class="fas fa-bars"></i>
</button>
</nav>
<div id="wrapper">
<!-- Sidebar -->
<ul class="sidebar navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="index.html">
<i class="fas fa-map-marker"></i>
<span>Map</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="Foods.html">
<i class="fas fa-utensils" area-hidden ="true"></i>
<span>Foods</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="Entertainment.html">
<i class="fas fa-gamepad"></i>
<span>Entertainment</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="Rooms.html">
<i class="fas fa-bed"></i>
<span>Rooms</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="Favorite.html">
<i class="fas fa-heart"></i>
<span>Favorite</span>
</a>
</li>
</ul>
<div id="content-wrapper">
<script>
// This example requires the Places library. Include the libraries=places
// parameter when you first load the API. For example:
// <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places">
var map;
var infowindow;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: -34.397, lng: 150.644},
zoom: 17
});
infowindow = new google.maps.InfoWindow();
// Try HTML5 geolocation.
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
var pos = {
lat: position.coords.latitude,
lng: position.coords.longitude
};
map.setCenter(pos);
var service = new google.maps.places.PlacesService(map);
service.nearbySearch({
location: pos,
radius: 500,
type: ['bakery']
}, callback_foods);
service.nearbySearch({
location: pos,
radius: 500,
type: ['bar']
}, callback_foods);
service.nearbySearch({
location: pos,
radius: 500,
type: ['cafe']
}, callback_foods);
service.nearbySearch({
location: pos,
radius: 500,
type: ['department_store']
}, callback_entertainment);
service.nearbySearch({
location: pos,
radius: 500,
type: ['lodging']
}, callback_rooms);
service.nearbySearch({
location: pos,
radius: 500,
type: ['meal_delivery']
}, callback_foods);
service.nearbySearch({
location: pos,
radius: 500,
type: ['meal_takeaway']
}, callback_foods);
service.nearbySearch({
location: pos,
radius: 500,
type: ['movie_theater']
}, callback_entertainment);
service.nearbySearch({
location: pos,
radius: 500,
type: ['museum']
}, callback_entertainment);
service.nearbySearch({
location: pos,
radius: 500,
type: ['night_club']
}, callback_entertainment);
service.nearbySearch({
location: pos,
radius: 500,
type: ['restaurant']
}, callback_foods);
service.nearbySearch({
location: pos,
radius: 500,
type: ['shopping_mall']
}, callback_entertainment);
service.nearbySearch({
location: pos,
radius: 500,
type: ['zoo']
}, callback_entertainment);
});
}
}
function callback_foods(results, status) {
if (status === google.maps.places.PlacesServiceStatus.OK) {
for (var i = 0; i < results.length; i++) {
createMarker_foods(results[i]);
}
}
}
function callback_entertainment(results, status) {
if (status === google.maps.places.PlacesServiceStatus.OK) {
for (var i = 0; i < results.length; i++) {
createMarker_entertainment(results[i]);
}
}
}
function callback_rooms(results, status) {
if (status === google.maps.places.PlacesServiceStatus.OK) {
for (var i = 0; i < results.length; i++) {
createMarker_rooms(results[i]);
}
}
}
</ul>
function createMarker_foods(place) {
var marker = new google.maps.Marker({
map: map,
position: place.geometry.location,
icon : "./icons/restaurant-15.svg",
//fillcolor : "#FF0000"
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.setContent(place.name);
infowindow.open(map, this);
});
}
function createMarker_entertainment(place) {
var placeLoc = place.geometry.location;
var marker = new google.maps.Marker({
map: map,
position: place.geometry.location,
icon : "./icons/gaming-15.svg"
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.setContent(place.name);
infowindow.open(map, this);
});
}
function createMarker_rooms(place) {
var placeLoc = place.geometry.location;
var marker = new google.maps.Marker({
map: map,
position: place.geometry.location,
icon : "./icons/lodging-15.svg"
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.setContent(place.name);
infowindow.open(map, this);
});
}
</script>
<div id="content-wrapper">
<script type="text/javascript" src="js/getPlaceList.js"></script>
<div id="map"></div>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDg4CkUEEt_96n1ork1nL5t4E_SpdKrgMI&libraries=places&callback=initMap" async defer></script>
<!-- Sticky Footer -->
......
var map;
var pos;
var infowindow;
var service;
var result_food = [];
var result_entertainment = [];
var result_room = [];
export { pos as posiiton };
export { result_food as foodList };
export { result_entertainment as entList };
export { result_room as roomList };
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: -34.397, lng: 150.644},
zoom: 17
});
infowindow = new google.maps.InfoWindow();
// Try HTML5 geolocation.
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
pos = {
lat: position.coords.latitude,
lng: position.coords.longitude
};
map.setCenter(pos);
service = new google.maps.places.PlacesService(map);
service.nearbySearch({
location: pos,
radius: 500,
type: ['bakery']
}, callback_foods);
searchPlace('bar','food');
searchPlace('cafe','food');
searchPlace('meal_delivery','food');
searchPlace('meal_takeaway','food');
searchPlace('restaurant','food');
searchPlace('department_store','entertainment');
searchPlace('movie_theater','entertainment');
searchPlace('museum','entertainment');
searchPlace('night_club','entertainment');
searchPlace('shopping_mall','entertainment');
searchPlace('zoo','entertainment');
searchPlace('lodging','room');
});
}
}
function searchPlace(str, placeType) {
switch(placeType) {
case 'food':
service.nearbySearch({
location: pos,
radius: 500,
type: ['meal_takeaway']
}, callback_foods);
break;
case 'entertainment':
service.nearbySearch({
location: pos,
radius: 500,
type: [str.toString()]
}, callback_entertainment);
break;
case 'room':
service.nearbySearch({
location: pos,
radius: 500,
type: ['lodging']
}, callback_rooms);
break;
default:
break;
}
}
function callback_foods(results, status) {
if (status === google.maps.places.PlacesServiceStatus.OK) {
for (var i = 0; i < results.length; i++) {
result_food.push(results[i]);
createMarker_foods(results[i]);
}
}
}
function callback_entertainment(results, status) {
if (status === google.maps.places.PlacesServiceStatus.OK) {
for (var i = 0; i < results.length; i++) {
result_entertainment.push(results[i]);
createMarker_entertainment(results[i]);
}
}
}
function callback_rooms(results, status) {
if (status === google.maps.places.PlacesServiceStatus.OK) {
for (var i = 0; i < results.length; i++) {
result_room.push(results[i]);
createMarker_rooms(results[i]);
}
}
}
function createMarker_foods(place) {
var marker = new google.maps.Marker({
map: map,
position: place.geometry.location,
icon : "./icons/restaurant-15.svg",
//fillcolor : "#FF0000"
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.setContent(place.name);
infowindow.open(map, this);
});
}
function createMarker_entertainment(place) {
var placeLoc = place.geometry.location;
var marker = new google.maps.Marker({
map: map,
position: place.geometry.location,
icon : "./icons/gaming-15.svg"
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.setContent(place.name);
infowindow.open(map, this);
});
}
function createMarker_rooms(place) {
var placeLoc = place.geometry.location;
var marker = new google.maps.Marker({
map: map,
position: place.geometry.location,
icon : "./icons/lodging-15.svg"
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.setContent(place.name);
infowindow.open(map, this);
});
}
import entList from 'getPlaceList'
//import position from 'getPlaceList'
import foodList from 'getPlaceList'
import roomList from 'getPlaceList'