()
| 1149 | } |
| 1150 | |
| 1151 | function centerMapOnLocation () { |
| 1152 | var currentLocation = document.getElementById('current-location') |
| 1153 | var imgX = '0' |
| 1154 | var animationInterval = setInterval(function () { |
| 1155 | if (imgX === '-18') { |
| 1156 | imgX = '0' |
| 1157 | } else { |
| 1158 | imgX = '-18' |
| 1159 | } |
| 1160 | currentLocation.style.backgroundPosition = imgX + 'px 0' |
| 1161 | }, 500) |
| 1162 | if (navigator.geolocation) { |
| 1163 | navigator.geolocation.getCurrentPosition(function (position) { |
| 1164 | var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude) |
| 1165 | locationMarker.setPosition(latlng) |
| 1166 | map.setCenter(latlng) |
| 1167 | Store.set('followMyLocationPosition', { lat: position.coords.latitude, lng: position.coords.longitude }) |
| 1168 | clearInterval(animationInterval) |
| 1169 | currentLocation.style.backgroundPosition = '-144px 0px' |
| 1170 | }) |
| 1171 | } else { |
| 1172 | clearInterval(animationInterval) |
| 1173 | currentLocation.style.backgroundPosition = '0px 0px' |
| 1174 | } |
| 1175 | } |
| 1176 | |
| 1177 | function changeLocation (lat, lng) { |
| 1178 | var loc = new google.maps.LatLng(lat, lng) |
no outgoing calls
no test coverage detected