Created
April 21, 2019 17:57
-
-
Save DanielSmith/3a17ff72d9d06dbd6bcc9ebb7221a03c to your computer and use it in GitHub Desktop.
updated-searchResultsMarkers.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
searchResultMarkers(results) { | |
// if we have not pulled in City Boundaries, this is our default | |
let filteredresults = results; | |
if (this.mapNumGeometries > 0 && this.mapGoogleGeometryMultiPoly) { | |
filteredresults = []; | |
results.map((curPlace) => { | |
for (let i = 0; i < this.mapNumGeometries; i++) { | |
if (google.maps.geometry.poly.containsLocation( | |
curPlace.geometry.location, | |
this.mapGoogleGeometryMultiPoly [i]) == true) { | |
filteredresults.push(curPlace); | |
} | |
} | |
}); | |
} | |
filteredresults.map((place) => { | |
let image = { | |
url: place.icon, | |
size: new google.maps.Size(71, 71), | |
origin: new google.maps.Point(0, 0), | |
anchor: new google.maps.Point(0, 0), | |
scaledSize: new google.maps.Size(15, 15) | |
}; | |
let marker = new google.maps.Marker({ | |
map: this.map, | |
icon: image, | |
title: place.name, | |
position: place.geometry.location | |
}); | |
}) | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment