# Map zoom level for multiple markers

**URL:** <https://community.thunkable.com/t/map-zoom-level-for-multiple-markers/564537>\
**Category:** Questions about Thunkable X\
**Created:** [May 1, 2020, 5:47pm UTC](https://community.thunkable.com/t/map-zoom-level-for-multiple-markers/564537 "2020-05-01T17:47:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ringraith2](https://avatars.discourse-cdn.com/v4/letter/r/9f8e36/32.png) [@ringraith2](https://community.thunkable.com/u/ringraith2)\
**Post date:** [May 1, 2020, 5:47pm UTC](https://community.thunkable.com/t/map-zoom-level-for-multiple-markers/564537/1 "2020-05-01T17:47:08Z")

</div>

Hello there all thunkers,

I’m trying to control the zoom level of multiple custom markers in google maps.  
What I need to do is to, after adding 2 or more markers in google map in my app, the zoom level would be accordingly leveled up (zoom out) so I can see them (ALL) in screen.

Is there any way to do this?  
Any blocks or logic would be highly appreciated.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [May 1, 2020, 6:27pm UTC](https://community.thunkable.com/t/map-zoom-level-for-multiple-markers/564537/2 "2020-05-01T18:27:42Z")

</div>

I think if you can figure out how many miles a zoom level shows across the map

Then figure out the distance between two points.

You could set the map accordingly

---

<div class="post-metadata">

**Author:** ![ringraith2](https://avatars.discourse-cdn.com/v4/letter/r/9f8e36/32.png) [@ringraith2](https://community.thunkable.com/u/ringraith2)\
**Post date:** [May 1, 2020, 6:37pm UTC](https://community.thunkable.com/t/map-zoom-level-for-multiple-markers/564537/3 "2020-05-01T18:37:44Z")

</div>

Thanks for your quick answer Jared,  
that was a thought of mine too, but i want to somehow center my map so all of my markers could be visible.  
And… is there any scale map documentation or anything, that points to how many miles shows in which zoom level?

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [May 1, 2020, 6:52pm UTC](https://community.thunkable.com/t/map-zoom-level-for-multiple-markers/564537/4 "2020-05-01T18:52:03Z")

</div>

That makes sense. These two links might answer your questions.

> <https://stackoverflow.com/questions/9356724/google-map-api-zoom-range>

[https://www.geomidpoint.com/calculation.html](https://www.geomidpoint.com/calculation.html)

---

<div class="post-metadata">

**Author:** ![ringraith2](https://avatars.discourse-cdn.com/v4/letter/r/9f8e36/32.png) [@ringraith2](https://community.thunkable.com/u/ringraith2)\
**Post date:** [May 2, 2020, 3:32pm UTC](https://community.thunkable.com/t/map-zoom-level-for-multiple-markers/564537/5 "2020-05-02T15:32:27Z")

</div>

Thanks for the references and all the help Jared. I studied the very complex algorithm for geomidpoint (although I didn’t understand it) and logically it makes sense but I need to see the results in my screen after implement it in my code.  
I’ll come back when I have any results.

Thanks again

---

<div class="post-metadata">

**Author:** ![ringraith2](https://avatars.discourse-cdn.com/v4/letter/r/9f8e36/32.png) [@ringraith2](https://community.thunkable.com/u/ringraith2)\
**Post date:** [June 2, 2020, 6:00pm UTC](https://community.thunkable.com/t/map-zoom-level-for-multiple-markers/564537/6 "2020-06-02T18:00:05Z")

</div>

I’m back (as I promised), just to thanks Jared, for his propositions. I finally managed to implement the mathematical type for finding the Midpoint of several points and in combination with a constructed scale of mine, I have almost the results I want, for showing multiple marks on map, in certain zoom level.  
Yet, after that, I changed the mathematical type of the above complex midpoint algorithm with a much shorter code that works as good (if not better) from the first.  
Just for future reference ,if anyone wants to use it, for finding midpoint of x points i used this formula :

map latitude = ((lat\_max + lat\_min) / 2  
map longitude = ((lng\_max + lng\_min) / 2

Happy coding

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 11:28am UTC](https://community.thunkable.com/t/map-zoom-level-for-multiple-markers/564537/7 "2024-11-08T11:28:47Z")

</div>


