Skip to content

Commit beed398

Browse files
authored
Update README.md
1 parent 1738710 commit beed398

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,29 @@ Ref.
9191
* http://stackoverflow.com/questions/13901520/grey-area-in-google-maps
9292
* http://blog.codebusters.pl/en/google-maps-in-hidden-div/
9393

94+
## Check if a marker is within Map, Rectangle, or Circle
95+
96+
map.getBounds().contains(marker.getPosition()
97+
98+
* http://stackoverflow.com/questions/3648545/how-can-i-check-the-marker-is-or-isnt-in-the-bounds-using-google-maps-v3
99+
* https://developers.google.com/maps/documentation/javascript/3.exp/reference#Map
100+
* https://developers.google.com/maps/documentation/javascript/3.exp/reference#Rectangle
101+
* https://developers.google.com/maps/documentation/javascript/3.exp/reference#Circle
102+
103+
## Calculate distance between two position
104+
105+
You may checkout this, https://developers.google.com/maps/documentation/javascript/distancematrix.
106+
As you see, DistanceMatrix does not require map nor directive.
107+
108+
Another way to do is to use directions directive. As you see it here, https://rawgit.com/allenhwkim/angularjs-google-maps/master/testapp/directions2.html, you have access to DirectionsRenderer by using `map.directionsRenderers[id]`
109+
110+
https://developers.google.com/maps/documentation/javascript/reference?hl=en#DirectionsRenderer
111+
112+
You use getDirections() or directions, then calculate the distance from there. e.g.,
113+
114+
Distance:
115+
{{map.directionsRenderers[0].directions.routes[0].legs[0].distance}}
116+
94117
Directives
95118
----------
96119

0 commit comments

Comments
 (0)