zet-lib 1.2.101 → 1.2.102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/moduleLib.js +6 -0
  2. package/package.json +1 -1
package/lib/moduleLib.js CHANGED
@@ -91,6 +91,11 @@ m.location = function (req, res, key) {
91
91
  if(mapLocationJSON && mapLocationJSON.lat) {
92
92
  $("#search_map_location").val(mapLocationJSON.address1);
93
93
  initMap(mapLocationJSON.lat,mapLocationJSON.lon);
94
+ } else {
95
+ navigator.geolocation.getCurrentPosition(function(location) {
96
+ initMap(location.coords.latitude,location.coords.longitude);
97
+ $("#search_map_location").val("My Place");
98
+ });
94
99
  }
95
100
  searchAddressMap = document.querySelector("#search_map_location");
96
101
  autocompleteMap = new google.maps.places.Autocomplete(searchAddressMap, {
@@ -100,6 +105,7 @@ m.location = function (req, res, key) {
100
105
  searchAddressMap.focus();
101
106
  autocompleteMap.addListener("place_changed", fillInAddress);
102
107
  }
108
+
103
109
  function fillInAddress() {
104
110
  const place = autocompleteMap.getPlace();
105
111
  let lat = place.geometry.location.lat();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zet-lib",
3
- "version": "1.2.101",
3
+ "version": "1.2.102",
4
4
  "description": "zet is a library that part of zet generator.",
5
5
  "engines": {
6
6
  "node": ">=18"