()
| 161 | } |
| 162 | |
| 163 | function createLocationMarker () { |
| 164 | var position = Store.get('followMyLocationPosition') |
| 165 | var lat = ('lat' in position) ? position.lat : centerLat |
| 166 | var lng = ('lng' in position) ? position.lng : centerLng |
| 167 | |
| 168 | var locationMarker = new google.maps.Marker({ |
| 169 | map: map, |
| 170 | animation: google.maps.Animation.DROP, |
| 171 | position: { |
| 172 | lat: lat, |
| 173 | lng: lng |
| 174 | }, |
| 175 | draggable: true, |
| 176 | icon: null, |
| 177 | optimized: false, |
| 178 | zIndex: google.maps.Marker.MAX_ZINDEX + 2 |
| 179 | }) |
| 180 | |
| 181 | locationMarker.infoWindow = new google.maps.InfoWindow({ |
| 182 | content: '<div><b>My Location</b></div>', |
| 183 | disableAutoPan: true |
| 184 | }) |
| 185 | |
| 186 | addListeners(locationMarker) |
| 187 | |
| 188 | google.maps.event.addListener(locationMarker, 'dragend', function () { |
| 189 | var newLocation = locationMarker.getPosition() |
| 190 | Store.set('followMyLocationPosition', { lat: newLocation.lat(), lng: newLocation.lng() }) |
| 191 | }) |
| 192 | |
| 193 | return locationMarker |
| 194 | } |
| 195 | |
| 196 | function updateSearchMarker (style) { |
| 197 | if (style in searchMarkerStyles) { |
no test coverage detected