Fixed a couple of things like (locate me, location edit)

This commit is contained in:
=
2019-10-18 03:29:15 -07:00
parent bfb510252b
commit 9b830bdd01
5 changed files with 52 additions and 22 deletions

View File

@@ -50,6 +50,5 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/noUiSlider/13.1.5/nouislider.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/wnumb/1.1.0/wNumb.min.js"></script>
</body>
</html>

View File

@@ -1,14 +1,13 @@
<div class="row center-align">
<h3>
Područje na mapi će biti uključeno u pretragu. Namjestite mapu na ulice
koje želite da budu vidljive.
</h3>
</div>
<div class="row center-align">
<div class="col s9 m10 l11 xl11">
<input id="autocompleteInput" placeholder="Lokacija..." type="text" />
</div>
<div class="col s1 m1 l1 xl1">
<a id="locateMe" class="btn-floating waves-effect waves-light"><i class="material-icons right">gps_fixed</i></a>
<div class="col s12 m12 l12 xl12">
<input id="autocompleteInput" placeholder="Unesite grad, naselje ili ulicu..." type="text" />
</div>
</div>
@@ -100,6 +99,26 @@
autocomplete.bindTo('bounds', map);
autocomplete.addListener('place_changed', onPlaceChanged);
pacSelectFirst(inputElement);
addLocateMeButton(map);
}
function addLocateMeButton(map) {
var parent = document.createElement('div');
parent.className = "locate-me-container";
var a = document.createElement('a');
a.id = "locateMe";
a.className = "btn-floating";
var i = document.createElement('i');
i.innerText = "gps_fixed";
i.className = "material-icons right";
a.appendChild(i)
a.addEventListener("click", locateMe);
parent.appendChild(a)
map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(parent)
}
function onPlaceChanged() {
@@ -156,8 +175,7 @@
$("#form-map-output").submit();
});
document.getElementById("locateMe").addEventListener("click", locateMe);
});
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAna8ohfV2HBMcxGk_29vqxU5Z_bDickqg&language=bs&libraries=places&callback=initMap" async
defer></script>
defer></script>