Questions tagged [fitbounds]

92 questions
6
votes
3 answers

setbounds on google maps api v3

I'm trying to set the bounds of a map fitbounds doesnt work because it puts some space around the bounds therefore doing {{{map.fitBounds(map.getBounds())}}} a few times will quickly zoom the map out I need to be able to…
msaspence
  • 1,424
  • 2
  • 14
  • 25
6
votes
1 answer

Include open infowindows within bounds of map, when using fitbounds

I have a map which contains multiple markers with infowindows. The infowindows need to be open on page load. The map is being centered using setbounds to incorporate all of the markers, which works, but it also needs to include the infowindows…
Dan
  • 5,836
  • 22
  • 86
  • 140
6
votes
1 answer

GMSCoordinateBounds IncludingCoordinates not working properly in Google Maps SDK for iOS

I'm trying to use the fitBounds method to fit all my markers in the google maps camera view. So I have my markers stored in markersArray and I use the following code to init GMSCoordinateBounds with the 1st and 2nd markers in markersArray which…
Ali
  • 4,205
  • 4
  • 25
  • 40
5
votes
1 answer

Zoom to fit leaflet.js markers

I'm converting my site from google maps to leaflet/openstreetmap. On the site, search results show up as markers on a map. Results can have one marker, or 10, or 200. That's all fine and great. But when the results have multiple markers, I'm having…
Ganberry
  • 79
  • 1
  • 8
5
votes
2 answers

Fit Bounds in Google Map Render Directions

I am trying to render directions for 48 waypoints, but google only allows 8 waypoints to be rendered per request. so I do multiple requests (in my case 6). However, the API somehow doed fitBounds() for the last request. How can I show all the 48…
5
votes
1 answer

Fitting piecewise function in gnuplot

I want to fit multiple bounded functions in gnuplot, fitting the bound values as well. For example: f(x)=a (for x < b) f(x)=a+(x-b)**c (for x > b) fit f(x) 'data.dat' via a,b,c Is there a way to do this?
4
votes
0 answers

google maps api fitbound with offset?

I have a google map with a custom control over it, covering 35% of the right area: var myControl = document.getElementById('tireshopsPickerList'); map.controls[google.maps.ControlPosition.RIGHT_CENTER].push(myControl); When the user enter an…
Max Favilli
  • 6,161
  • 3
  • 42
  • 62
4
votes
2 answers

How can I fitBounds for all shapes on the map?

There are a lot of shapes on the map and they are all saved inside this array array_shapes_object[]. How can I show all of them on the map by fitBounds method? I can use something…
UserMat
  • 600
  • 4
  • 10
  • 27
3
votes
2 answers

Dynamic bounds change does not give any effect in 'react-leaflet'

I encountered the problem while trying to use the react-leaflet's bounds property. My use case is that my application has some initial bounds defined in the state (let's say, fallback bounds), and those bounds are passed during the first render of…
daniel_s
  • 3,635
  • 1
  • 8
  • 24
3
votes
0 answers

Mapbox fitbounds option not working only Android, works in IOS

I am using Mapboxgl for React Native project. And I have trouble with fitbounds function It works well on IOS but not working on Android, it shows whole world map always. This is my code import MapboxGL from '@mapbox/react-native-mapbox-gl'; export…
Nomura Nori
  • 4,689
  • 8
  • 47
  • 85
3
votes
2 answers

Swift GoogleMaps fitBounds Zoom

New coder try to fit GoogleMap in my view. I have searched a lot of information and I have come to this conclusion, but it does not work for me. override func loadView() { var markerList = [GMSMarker]() // Create a GMSCameraPosition …
Raul F.
  • 81
  • 1
  • 10
3
votes
1 answer

Leaflet - Zoom/Pan to Layer Extent when Toggling Layers

I am working on a bus route map, and have several routes that users can turn on and off. I would like to work out how to zoom/pan so that the chosen route (or routes) are fully on screen when chosen. (some are off screen with the initial zoom…
Isendra
  • 57
  • 1
  • 4
3
votes
0 answers

Google maps fitBounds() does not work as expected

I try to zoom to a number of km on a location (Paris, in my case), like this: map.myCircle = circle; // update radius map.myCircle.radius = newRadius; // update map -…
serge
  • 13,940
  • 35
  • 121
  • 205
3
votes
3 answers

Google Maps JavaScript API - fitbounds together with setCenter

I've been looking around for a solution to this problem, but i can't seem to find somthing that solves this. The closest i get is this thread. But this doesn't work. What i'm trying to do is to run fitbounds based on a set of markers which works…
Jan Banan
  • 161
  • 2
  • 7
3
votes
1 answer

google map map.fitBounds() and bounds.extend() are not working as expected.

I have a piece of code below which is using bounds.extend() and map.fitBounds() to resize the map to accommodate all markers. I would expect the map could focus to start_point as a center and zoom out to a appropriate level so every markers would…