Questions tagged [fitbounds]

92 questions
0
votes
1 answer

map.fitbounds not doing anything

I have a script which takes data from html and uses it to plot routes on a map. I'm trying to get it to take all the routes and zoom to show all of them. Here's the code: var ombounds = new google.maps.LatLngBounds(); //bounds for (var r=1;…
ninjachicken1
  • 177
  • 1
  • 1
  • 10
0
votes
1 answer

fitBounds() is not working with geocoder function

I have just updated my code from v2 to v3. Every thing is working but the function map.fitBounds(); Here is my sample code var geocoder = new google.maps.Geocoder(); geocoder.geocode( { 'address': 'your address'}, >function(results, status)…
IamSalik
  • 123
  • 1
  • 7
0
votes
2 answers

Override Google Maps Directions Zoom

I am trying to over-ride Google Maps driving directions zoom. Yes, I have seen another question here on stackoverflow that is identical; however, that solution is not working for me. Here is where I call a new DirectionsRenderer, and I define…
SMPLGRP
  • 251
  • 3
  • 8
  • 22
0
votes
1 answer

fitBounds and extend - showing up at a completely different place

var classBounds = new google.maps.LatLngBounds(); var query = ""; query = "SELECT 'ROAD_NUMBER', 'geometry' FROM [TABLE_ID HERE] WHERE 'ROAD_NUMBER' CONTAINS IGNORING CASE '" + searchString + "' AND 'LINK_NUMBER' CONTAINS '" +searchStringLinkNo +…
Matthew Paxman
  • 247
  • 2
  • 4
  • 13
0
votes
1 answer

Google Maps API fitBounds doesn't set zoom correctly

I'm have an issue where I don't think the fitBounds call is setting the zoom level appropriately. I have managed to reproduce my test case here http://tom.haddons.net/map.html - basically the four outer points are the bounds I'm setting, and if you…
tomasito
  • 27
  • 7
0
votes
1 answer

Google maps draggable marker zoom to fit all markers

I have a working version of map with a draggable marker. Zoom-in to include all markers works bounds.extend(results[0].geometry.location); map.fitBounds(bounds); where results[0].geometry.location is new draggable location. This works if the new…
kyc
  • 85
  • 1
  • 12
0
votes
1 answer

Google Maps V3 fitBounds zooms to a closer view when called a second time with the same bounds

function ZoomCenter(bounds, canvas) { var center = bounds.getCenter(); if (canvas.getMapTypeId() == "roadmap") canvas.fitBounds(bounds); else { var maxZoomService = new google.maps.MaxZoomService(); …
0
votes
1 answer

How to overwrite Google Map initialized opts with fitBounds();

I've been searching for a way to overwrite a Google map's center latlng and zoom using the fitBounds() method. As you can see I have an array of latlng coordinates which I would like to all fit within the map at the correct zoom. Annoyingly, the map…
-1
votes
1 answer

How to make map cover all markers in javascript?

I have an issue with Google Map in javascript, I can not make all markers fit bounds. Only the first marker is visible. This is the error thrown in console: uncaught exception: InvalidValueError: not a LatLngBounds or LatLngBoundsLiteral: not an…
Besart
  • 309
  • 1
  • 4
  • 22
-1
votes
1 answer

How to fitBounds groundOverlay google maps api more closely

I created a groundOverlay that uses the Google Maps API. I'd like to make the ground fit much as possible. I also tried to use padding option or zoom++ but it not work as I expected. Current: Expected: Re-production:…
Binh Ho
  • 3,690
  • 1
  • 31
  • 31
-1
votes
1 answer

Does Google Maps fitBounds() regenerate the map?

I always used to work with panTo instead of setCenter to recenter a Google map because I read somewhere that using panTo is not being counted as a new daily usage of map (to consider the daily limitation of using google map on my website) but I…
Ali Sheikhpour
  • 10,475
  • 5
  • 41
  • 82
-1
votes
1 answer

how to calculate the coordinate points for the fitBounds()?

How do I calculate the coordinate points for the fitBounds() method to get the exact area in MapBox?
-1
votes
1 answer

Google Map Api auto-fit (fitBounds) with complex KML

I have a tool using the Google Maps API. I load KML polygons from a huge KML database, containing all KML for every city in France. Then I merge them to create a complex KML containing multiple cities. I used to call an old Maps API version, and the…
Pete_Gore
  • 594
  • 1
  • 5
  • 20
-1
votes
1 answer

Google Maps V3 API - Center on a category pulling from xml file

I'm working with this example from Geocodezip The markers on the map change depending on which category is selected. I would like them to automatically center on the category of markers but I'm having difficulty getting it to work. The issue I'm…
-1
votes
1 answer

Completely new to javascript and using Google Maps API v3 w/ custom fitbounds (myFitBounds)

I've been teaching myself Javascript through online examples and trial and error for a little while now but I've come upon an issue that I just do not freaking understand and it is driving me pretty much crazy. Please excuse any and all flub ups in…
GoOutside
  • 103
  • 1
  • 2
  • 11