Προσθήκη Νέας Επιχείρησης

Γενικές Πληροφορίες

Στοιχεία Επικοινωνίας

Opening/Business Hour Information

Χάρτης (Τοποθεσία)

    You can drag pinpoint to place the correct address manually.

    Γκαλερί

    *
    *
    "; markers = [];// initialize the array to keep track all the marker info_window = new google.maps.InfoWindow({ content: info_content, maxWidth: 400 }); address_input = document.getElementById('address'); address_input.addEventListener('focus', geolocate); // this function will work on sites that uses SSL, it applies to Chrome especially, other browsers may allow location sharing without securing. function geolocate() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function (position) { var geolocation = { lat: position.coords.latitude, lng: position.coords.longitude }; var circle = new google.maps.Circle({ center: geolocation, radius: position.coords.accuracy }); autocomplete.setBounds(circle.getBounds()); }); } } function initAutocomplete() { // Create the autocomplete object, restricting the search to geographical // location types. autocomplete = new google.maps.places.Autocomplete( (address_input), {types: []}); // When the user selects an address from the dropdown, populate the necessary input fields and draw a marker autocomplete.addListener('place_changed', fillInAddress); } function fillInAddress() { // Get the place details from the autocomplete object. var place = autocomplete.getPlace(); // set the value of input field to save them to the database $manual_lat.val(place.geometry.location.lat()); $manual_lng.val(place.geometry.location.lng()); map.setCenter(place.geometry.location); var marker = new google.maps.Marker({ map: map, position: place.geometry.location }); // marker.addListener('click', function () { // info_window.open(map, marker); // }); // add the marker to the markers array to keep track of it, so that we can show/hide/delete them all later. markers.push(marker); } initAutocomplete(); // start google map place auto complete API call function initMap() { /* Create new map instance*/ map = new google.maps.Map(document.getElementById('gmap'), { zoom: 12, center: saved_lat_lng }); var marker = new google.maps.Marker({ map: map, position: saved_lat_lng, draggable: true, title: 'Μπορείτε να επιλέξετε το ακριβές σημείο τοποθετώντας το σύμβολο χειροκίνητα.' }); // marker.addListener('click', function () { // info_window.open(map, marker); // }); // add the marker to the markers array to keep track of it, so that we can show/hide/delete them all later. markers.push(marker); // create a Geocode instance var geocoder = new google.maps.Geocoder(); document.getElementById('generate_admin_map').addEventListener('click', function (e) { e.preventDefault(); geocodeAddress(geocoder, map); }); // This event listener calls addMarker() when the map is clicked. google.maps.event.addListener(map, 'click', function (event) { deleteMarker(); // at first remove previous marker and then set new marker; // set the value of input field to save them to the database $manual_lat.val(event.latLng.lat()); $manual_lng.val(event.latLng.lng()); // add the marker to the given map. addMarker(event.latLng, map); }); // This event listener update the lat long field of the form so that we can add the lat long to the database when the MARKER is drag. google.maps.event.addListener(marker, 'dragend', function (event) { // set the value of input field to save them to the database $manual_lat.val(event.latLng.lat()); $manual_lng.val(event.latLng.lng()); }); } /* * Geocode and address using google map javascript api and then populate the input fields for storing lat and long * */ function geocodeAddress(geocoder, resultsMap) { var address = address_input.value; var lat = document.getElementById('manual_lat').value; var lng = document.getElementById('manual_lng').value; var latLng = new google.maps.LatLng( lat, lng ); var opt = { location: latLng, address: address }; geocoder.geocode(opt, function (results, status) { if (status === 'OK') { // set the value of input field to save them to the database $manual_lat.val(results[0].geometry.location.lat()); $manual_lng.val(results[0].geometry.location.lng()); resultsMap.setCenter(results[0].geometry.location); var marker = new google.maps.Marker({ map: resultsMap, position: results[0].geometry.location }); // marker.addListener('click', function () { // info_window.open(map, marker); // }); deleteMarker(); // add the marker to the markers array to keep track of it, so that we can show/hide/delete them all later. markers.push(marker); } else { alert('Geocode was not successful for the following reason: ' + status); } }); } initMap(); // adding features of creating marker manually on the map on add listing page. /*var labels = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; var labelIndex = 0;*/ // Adds a marker to the map. function addMarker(location, map) { // Add the marker at the clicked location, and add the next-available label // from the array of alphabetical characters. var marker = new google.maps.Marker({ position: location, /*label: labels[labelIndex++ % labels.length],*/ draggable: true, title: 'Μπορείτε να επιλέξετε το ακριβές σημείο τοποθετώντας το σύμβολο χειροκίνητα.', map: map }); // marker.addListener('click', function () { // info_window.open(map, marker); // }); // add the marker to the markers array to keep track of it, so that we can show/hide/delete them all later. markers.push(marker); } // Delete Marker $('#delete_marker').on('click', function (e) { e.preventDefault(); deleteMarker(); }); function deleteMarker() { for (var i = 0; i