|
1 | 1 | import Handlebars from "./lib/handlebars" |
2 | | - |
3 | 2 | import { stringsConfig } from "../js/shared/stringsConfig"; |
4 | 3 | import "../js/shared/strings"; |
5 | 4 |
|
@@ -166,6 +165,7 @@ window.mapView = { |
166 | 165 | }; |
167 | 166 |
|
168 | 167 | // Add a marker clusterer to manage the markers. |
| 168 | + console.log("is error from here"); |
169 | 169 | mapView.settings.markerClusterer = new MarkerClusterer(map, app.state.markers, clusterOptions); |
170 | 170 |
|
171 | 171 | }, |
@@ -222,22 +222,24 @@ window.mapView = { |
222 | 222 | }); |
223 | 223 | } |
224 | 224 | if (skip) return; |
225 | | - let marker = new google.maps.Marker({ |
226 | | - position: place.address, |
227 | | - markerData: place, |
228 | | - map: map, |
229 | | - icon: mapView.createMarker(iconType) |
230 | | - }); |
231 | | - |
232 | | - if(place.address){ |
233 | | - let lat = place.address.lat, |
234 | | - lng = place.address.lng; |
235 | | - |
236 | | - app.state.markers.push(marker); |
237 | | - app.state.bounds.extend({lat, lng}); |
238 | | - if (mapView.settings.markerClusterer) mapView.settings.markerClusterer.addMarker(marker); |
239 | | - |
240 | | - marker.addListener('click', () => {mapView.markerClick(place, marker)}); |
| 225 | + if(place && place.address && place.address.lat && place.address.lng){ |
| 226 | + let marker = new google.maps.Marker({ |
| 227 | + position: place.address, |
| 228 | + markerData: place, |
| 229 | + map: map, |
| 230 | + icon: mapView.createMarker(iconType) |
| 231 | + }); |
| 232 | + |
| 233 | + if(place.address){ |
| 234 | + let lat = place.address.lat, |
| 235 | + lng = place.address.lng; |
| 236 | + |
| 237 | + app.state.markers.push(marker); |
| 238 | + app.state.bounds.extend({lat, lng}); |
| 239 | + if (mapView.settings.markerClusterer) mapView.settings.markerClusterer.addMarker(marker); |
| 240 | + |
| 241 | + marker.addListener('click', () => {mapView.markerClick(place, marker)}); |
| 242 | + } |
241 | 243 | } |
242 | 244 | }, |
243 | 245 | markerClick: (place, marker) => { |
@@ -389,5 +391,6 @@ window.mapView = { |
389 | 391 |
|
390 | 392 | window.originalHeight = (app.views.mapView) ? app.views.mapView.getBoundingClientRect().height: 0; |
391 | 393 |
|
392 | | - } |
| 394 | + }, |
| 395 | + |
393 | 396 | }; |
0 commit comments