google-maps-api-3

Avoid infobox overlapping - google maps v3

≯℡__Kan透↙ 提交于 2020-01-02 23:23:12
问题 I display cruise routes on a google map and mark each port with an infobox. Unfortunately these infoboxes regularly overlap. How can this be avoided? I've already tried spiderfy but it's not suitable in this instance. Changing the zoom level of the map is also not an option. The ideal would be a plugin or something similar that can recognize overlapping infoboxes at creation and rearrange them. However, I haven't been able to find something like this anywhere. A second possibility would be to

Google Places JS API Show Reviews

可紊 提交于 2020-01-02 23:17:34
问题 JS API, not web service: I'm having trouble displaying the 0-5 reviews included with the Place Details Responses: https://developers.google.com/maps/documentation/javascript/places#place_details_responses So far I have been able to display these items: details.name details.rating details.open_now details.formatted_address details.types details.formatted_phone_number But when I try to show details.reviews it just displays: [object Object],[object Object],[object Object],[object Object],[object

Google maps details API does not return fields

流过昼夜 提交于 2020-01-02 22:33:28
问题 I am trying to retrieve information from the google maps place detail api. I am calling this url: https://maps.googleapis.com/maps/api/place/details/json?key=my_api_key&place_id=ChIJgQlGoRzcQUcRP8UPrtI8hcc&fields=geometry,price_level,rating,review,user_ratings_total The place id comes from the Place Search api, it is the id of this place. So I am requesting the following fields in the url: geometry, price level, rating, review, user_ratings_total, and my response is the following: { "html

Google forEach map.data feature - return feature LatLng

淺唱寂寞╮ 提交于 2020-01-02 22:16:32
问题 I am trying to iterate through GeoJSON map.data using a forEach. I want to return the position (LatLng) of each feature so I can add it to my markers array based on a feature property. Here's my attempt: allMarkers = []; jQuery.getJSON('json.php', function(data){ points = map.data.addGeoJson(data); }); var eid = 30; map.data.forEach(function(feature){ if(feature.getProperty('eid') === eid){ LatLng = feature.getGeometry().LatLng; //not sure how to get LatLng id = feature.getProerty('id'); var

Google forEach map.data feature - return feature LatLng

让人想犯罪 __ 提交于 2020-01-02 22:16:13
问题 I am trying to iterate through GeoJSON map.data using a forEach. I want to return the position (LatLng) of each feature so I can add it to my markers array based on a feature property. Here's my attempt: allMarkers = []; jQuery.getJSON('json.php', function(data){ points = map.data.addGeoJson(data); }); var eid = 30; map.data.forEach(function(feature){ if(feature.getProperty('eid') === eid){ LatLng = feature.getGeometry().LatLng; //not sure how to get LatLng id = feature.getProerty('id'); var

How to Reduce the padding of the Google Maps Places API v3 InfoWindow

 ̄綄美尐妖づ 提交于 2020-01-02 17:55:34
问题 I tried to get the id of the object with FireBug, but no success. I've also played around with the InfoBox code from google Maps, but was too complex, for the little thing I need, which is just to reduce the padding of the infowindow. 回答1: Line 17 of the page you linked to shows how the infowindow content is constructed: infowindow.setContent('<div><strong>' + place.name + '</strong><br>' + address); You'll need to set the padding for the either inline (e.g., style="padding: 0px;" ) or

Mouse events propagation from marker to underlying map

女生的网名这么多〃 提交于 2020-01-02 13:44:34
问题 I have one question, why dose mouse events related to a map never fire when we are over marker exp. having a mouse move listener added to a map is never called when we move over a marker (there is not so called event propagation or bubbling). This was actully working on maps v2! Is it a bug, or its changed to this behavior in v3? Blaze Here is the example... If you move around the map, the mapLabel is updated as should be but if u move over the marker the mapLabel is never updated var map;

Google API 3 open Infowindow from divs outside google maps

佐手、 提交于 2020-01-02 11:25:32
问题 As the title states how can I with Google API 3 open Infowindow from divs outside google maps. this is what I am doing today but this only working on the last div link and not every link markerObj = document.getElementById(markerId); markerObj.onclick = function(){ google.maps.event.trigger(marker, 'click'); } Any clues? 回答1: I think to make this work you'd need to have an array of markers. Then you'd trigger the click on the exact marker you want (right now it'll just do it on your last

Google API 3 open Infowindow from divs outside google maps

蓝咒 提交于 2020-01-02 11:23:28
问题 As the title states how can I with Google API 3 open Infowindow from divs outside google maps. this is what I am doing today but this only working on the last div link and not every link markerObj = document.getElementById(markerId); markerObj.onclick = function(){ google.maps.event.trigger(marker, 'click'); } Any clues? 回答1: I think to make this work you'd need to have an array of markers. Then you'd trigger the click on the exact marker you want (right now it'll just do it on your last

Google API 3 open Infowindow from divs outside google maps

若如初见. 提交于 2020-01-02 11:23:08
问题 As the title states how can I with Google API 3 open Infowindow from divs outside google maps. this is what I am doing today but this only working on the last div link and not every link markerObj = document.getElementById(markerId); markerObj.onclick = function(){ google.maps.event.trigger(marker, 'click'); } Any clues? 回答1: I think to make this work you'd need to have an array of markers. Then you'd trigger the click on the exact marker you want (right now it'll just do it on your last