google-maps-api-3

How to add markers in react-google-maps?

别来无恙 提交于 2020-05-10 06:21:28
问题 Using React JS in Meteor 1.5 Question : Need a way to add Marker using react-google-maps Using ES6 and in JSX format Followed the documentation and was able to get the map embedded in, but not able to add the marker. Here is my code: const InitialMap = withGoogleMap(props => { var index = this.marker.index || []; return( <GoogleMap ref={props.onMapLoad} defaultZoom={14} defaultCenter={{lat: 40.6944, lng:-73.9213}} > <Marker key={index} position={marker.position} onClick={() => props

How to add markers in react-google-maps?

这一生的挚爱 提交于 2020-05-10 06:21:09
问题 Using React JS in Meteor 1.5 Question : Need a way to add Marker using react-google-maps Using ES6 and in JSX format Followed the documentation and was able to get the map embedded in, but not able to add the marker. Here is my code: const InitialMap = withGoogleMap(props => { var index = this.marker.index || []; return( <GoogleMap ref={props.onMapLoad} defaultZoom={14} defaultCenter={{lat: 40.6944, lng:-73.9213}} > <Marker key={index} position={marker.position} onClick={() => props

Is it possible to get the “Popular times” information through the Google Places API

人走茶凉 提交于 2020-05-09 21:15:11
问题 Is it possible to get the "Popular times" information through the Google Places API or any other API? I need this information to be displayed in my application for a particular place. 回答1: I haven't managed to test it myself but this is what populartimes offers to do in Python: import populartimes populartimes.get("your-api-key", ["bar"], (48.132986, 11.566126), (48.142199, 11.580047)) More info on developer's github. 回答2: This is one of the top feature requests in Google issue tracker (more

Is it possible to get the “Popular times” information through the Google Places API

好久不见. 提交于 2020-05-09 21:07:36
问题 Is it possible to get the "Popular times" information through the Google Places API or any other API? I need this information to be displayed in my application for a particular place. 回答1: I haven't managed to test it myself but this is what populartimes offers to do in Python: import populartimes populartimes.get("your-api-key", ["bar"], (48.132986, 11.566126), (48.142199, 11.580047)) More info on developer's github. 回答2: This is one of the top feature requests in Google issue tracker (more

Loading a geoJSON object directly into google maps v3

时间秒杀一切 提交于 2020-05-09 19:26:31
问题 I'm trying to create a map, using floor plans that I've stored in mongodb. If I put the JSON into a file, I can call it using map.data.loadGeoJson('myfile.json') However, I don't want to save a file each time I build a map, and I'd rather write an object directly. Something like this: var tempObject = { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "letter": "G", "color": "blue", "rank": "7", "ascii": "71" }, "geometry": { "type": "Polygon", "coordinates": [

Google Maps API 3 - Show/ Hide markers depending on zoom level

空扰寡人 提交于 2020-05-07 10:09:11
问题 I'm trying to show/hide some google map markers depending on the zoom level. I've had a look on here for the answers and while I've got a better idea of what I'm meant to be doing I haven't had any luck being able to implement it into my google map. var infowindow = new google.maps.InfoWindow(); var marker, i; var locations = [ ['<div style="width: 170px;">Title1</div>', 50.794785, -1.116947, image], ['<div style="width: 190px;">Title2</div>', 50.797, -1.109, image], ['<div style="width:

Change individual markers in google maps directions api V3

南笙酒味 提交于 2020-04-25 17:13:19
问题 I'm looking to change the marker icons when using the DirectionsRender within a google map. I've figured out from here how to change both the markers to the same icon, but I am looking for custom icons on both the start and end points. Any ideas? Edit: I'm looking for how to assign separate icons to the start and end markers. I know how to change it for both, but having different marker icons is proving difficult. 回答1: For those that need an example like I did, here's a basic one: // Map and

Remove a circle object from a Google Map

僤鯓⒐⒋嵵緔 提交于 2020-04-21 06:22:11
问题 I have checked multiple similar posts on SO but haven't yet found the answer. I have a Google map app that when you Zoom in the marker changes from an icon to a circle. It works great. The Marker icon is replaced by the circle object. But, I also want it to work in reverse: As you zoom out, I want to remove the circle and replace it with the icon. I can get the icon to "reappear" but I can't figure out a way to get a reference to the circle object that is bound to the Marker so I can remove

Remove a circle object from a Google Map

懵懂的女人 提交于 2020-04-21 06:21:52
问题 I have checked multiple similar posts on SO but haven't yet found the answer. I have a Google map app that when you Zoom in the marker changes from an icon to a circle. It works great. The Marker icon is replaced by the circle object. But, I also want it to work in reverse: As you zoom out, I want to remove the circle and replace it with the icon. I can get the icon to "reappear" but I can't figure out a way to get a reference to the circle object that is bound to the Marker so I can remove

Google directions route - marker at midpoint

自作多情 提交于 2020-04-18 08:41:55
问题 How can I add a clickable marker in the middle of rendered route, which would then display a info window with custom data, because a info window can't be directly added to directions renderer? function loadRoute0() { var request0 = { origin: new google.maps.LatLng(46.56300788, 15.62779705), destination: new google.maps.LatLng(46.55953332, 15.62616729), travelMode: google.maps.TravelMode.WALKING }; directionsService.route(request0, function(result, status) { if (status == google.maps