google-maps-api-3

bounds google maps

依然范特西╮ 提交于 2020-01-05 06:44:09
问题 My Google maps API map zooms put to show all the markers added after a google places search. On a mobile map this can take a bit to load and as this app for cyclists I prefer to only show the results within the viewport. Most research I read indicates it is not possible to only return results within the view port. Is it possible for me to just keep the map bounds from changing after the markers are added? It would be great if it would just show me the markers added to the current bounds

Prevent map from repositioning when clicking a marker (Google Map v3)

此生再无相见时 提交于 2020-01-05 06:19:45
问题 Markers open a window containing a couple paragraphs of text. When users click a marker, the map repositions itself (typically shifting the map north) to display the pop-up. Is there a method for preventing this repositioning action? 回答1: Set the disableAutoPan option: infowindow.setOptions({disableAutoPan: true}); Documentation here 来源: https://stackoverflow.com/questions/14596635/prevent-map-from-repositioning-when-clicking-a-marker-google-map-v3

Toggle kml-Layer on styled map only works once

社会主义新天地 提交于 2020-01-05 05:55:10
问题 I'd like to have checkboxes to turn kml-Layers on and off. I tried to do that with a styled map in the google maps api v3. The Layers really do appear and I can toggle them off. But the button only works once. This (http://jsbin.com/irahef/186/edit) helped me a lot. Here they also use a styled google map: http://www.strahlen.org/map/map.htm I'm sure it's just a small mistake but I don't get it working. Does somebody has a clue? The Javascript looks like this: <html> <head> <script type="text

Markers with text on a Google GeoChart

限于喜欢 提交于 2020-01-05 05:45:08
问题 I'm trying to make a Google GeoChart that should look like this : But, problem is, I'm not even sure it is possible to mix up markers and text in them. Right now my code is the following : google.charts.load('current', {'packages':['geochart']}); google.charts.setOnLoadCallback(drawRegionsMap); function drawRegionsMap() { var data = google.visualization.arrayToDataTable([ ['Region', 'Gagnants'], ['Alsace', 6], ['Aquitaine', 1], ['Auvergne', 5], ['Basse-Normandie', 2], ['Bourgogne', 1], [

Google maps api locate corner coordinates

断了今生、忘了曾经 提交于 2020-01-05 05:24:47
问题 QUESTION: Is there a way that I could locate what the coordinates are of corner points of the google map each time I zooms in , zooms out , or shift the map? ELABORATING ON WHAT I MEAN: In my google maps api code, I giving the map a specific width and height: <style> #map { width:400px; height:300px; } </style> <script src="https://maps.googleapis.com/maps/api/js"></script> <div id="map"></div> <script> var mapOptions = { center: new google.maps.LatLng(37.7831, -122.4039), zoom: 12, mapTypeId

Google Places API mapping a company

核能气质少年 提交于 2020-01-05 04:58:40
问题 I'm trying to plot a marker in a Google Map where a company is, so for example I am looking for the Apple Store in Aberdeen, Scotland I would like a marker there and when I click the marker it will show the info window with the company details which is generated from Google with reviews etc. I can't find any documentation on how to do this, but the closest I found is a Company Lookup which then points you to the location. I'd rather be able to cut out the start and just have the company name

Google Maps - Trigger a click event on a data layer at a specific point (long/lat)

偶尔善良 提交于 2020-01-05 04:52:33
问题 I am loading a google map with GeoJSON, and after the map is loaded and the data layers are applied, I would like to trigger a click event at a specific point automatically for the user. Subsequently, they can click all over the map to interact with it. So for the automatic load part, I tried something like this: var x = new google.maps.LatLng(myLongitude, myLatitude); google.maps.event.trigger(map.data, 'click', WHAT_GOES_HERE?); but I can't figure out what goes in the last part of that

Google Maps - Trigger a click event on a data layer at a specific point (long/lat)

雨燕双飞 提交于 2020-01-05 04:52:05
问题 I am loading a google map with GeoJSON, and after the map is loaded and the data layers are applied, I would like to trigger a click event at a specific point automatically for the user. Subsequently, they can click all over the map to interact with it. So for the automatic load part, I tried something like this: var x = new google.maps.LatLng(myLongitude, myLatitude); google.maps.event.trigger(map.data, 'click', WHAT_GOES_HERE?); but I can't figure out what goes in the last part of that

KML layer problems in Google Maps Javascript API v3

我是研究僧i 提交于 2020-01-05 04:35:11
问题 Here's my code: <html><head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0; padding: 0 } #map-canvas { height: 500px; width: 500px; } </style> <title>Map Your Reps</title> <script type="text/javascript" src="https://maps.googleapis.com/maps/api /js?key={key}"></script> <script type="text/javascript"> function initialize() { var mapOptions = { center: new google.maps.LatLng(-34, 92), zoom: 7 }

Retrieve details on Bus Line or Subway in Google Map API

若如初见. 提交于 2020-01-05 04:07:26
问题 I'm looking for doing something like this website : WEBSITE GMAPS For the moment i can get everything around 500meters like if it's a bus stop or something else but i can't retrieve the Bus line. var mapControl = $scope.map.control.getGMap(); service = new google.maps.places.PlacesService(mapControl); var transitLayer = new google.maps.TransitLayer(); transitLayer.setMap(mapControl); var directionsService = new google.maps.DirectionsService(); service.search(request, callback); function