index.html 10.4 KB
<!DOCTYPE html>
<html lang="en">

  <head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>저기어때</title>

	<style>
      /* Always set the map height explicitly to define the size of the div
       * element that contains the map. */
      #map {
        height: 100%;
      }
      /* Optional: Makes the sample page fill the window. */
      html, body {
        height: 100%;
        margin: 0;
        padding: 0;
      }
    </style>
	
    <!-- Bootstrap core CSS-->
    <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom fonts for this template-->
    <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">

    <!-- Page level plugin CSS-->
    <link href="vendor/datatables/dataTables.bootstrap4.css" rel="stylesheet">

    <!-- Custom styles for this template-->
    <link href="css/sb-admin.css" rel="stylesheet">

  </head>

  <body id="page-top">

    <nav class="navbar navbar-expand navbar-dark bg-dark static-top">

      <a class="navbar-brand mr-1" href="index.html">저기어때</a>

      <button class="btn btn-link btn-sm text-white order-1 order-sm-0" id="sidebarToggle" href="#">
        <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]);
              }
          }
      }



      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="map"></div>
      <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDg4CkUEEt_96n1ork1nL5t4E_SpdKrgMI&libraries=places&callback=initMap" async defer></script>
        <!-- Sticky Footer -->
        <footer class="sticky-footer">
          <div class="container my-auto">
            <div class="copyright text-center my-auto">
              <span>Copyright © Your Website 2018</span>
            </div>
          </div>
        </footer>

    </div>
    <!-- /#wrapper -->

    <!-- Scroll to Top Button-->
    <a class="scroll-to-top rounded" href="#page-top">
      <i class="fas fa-angle-up"></i>
    </a>

    <!-- Logout Modal-->
    <div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
            <button class="close" type="button" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">×</span>
            </button>
          </div>
          <div class="modal-body">Select "Logout" below if you are ready to end your current session.</div>
          <div class="modal-footer">
            <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
            <a class="btn btn-primary" href="login.html">Logout</a>
          </div>
        </div>
      </div>
    </div>

    <!-- Bootstrap core JavaScript-->
    <script src="vendor/jquery/jquery.min.js"></script>
    <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

    <!-- Core plugin JavaScript-->
    <script src="vendor/jquery-easing/jquery.easing.min.js"></script>

    <!-- Page level plugin JavaScript-->
    <script src="vendor/chart.js/Chart.min.js"></script>
    <script src="vendor/datatables/jquery.dataTables.js"></script>
    <script src="vendor/datatables/dataTables.bootstrap4.js"></script>

    <!-- Custom scripts for all pages-->
    <script src="js/sb-admin.min.js"></script>

    <!-- Demo scripts for this page-->
    <script src="js/demo/datatables-demo.js"></script>
    <script src="js/demo/chart-area-demo.js"></script>

  </body>

</html>