google-maps-api-3

Setting HTTP referrers for Google's geocoding web service

白昼怎懂夜的黑 提交于 2020-05-14 05:49:05
问题 I have a JS application that is reading a URL which contains a city and state and geocoding those values to obtain a latitude and longitude. I am currently using the Google geocoding web service. This works fine with no restrictions on my API key but since this is client side JS I am trying to set HTTP referrers with website restrictions. When I add my site as an HTTP referrer (https://*.mysite.com/*) the application breaks. https://maps.googleapis.com/maps/api/geocode/json?address=city,

JavaScript variables undefined within setTimeout function

£可爱£侵袭症+ 提交于 2020-05-13 05:14:16
问题 I have the following code: for (var i = 0; i < markers.length; i++) { var lat = markers[i][0]; var lng = markers[i][1]; var img = markers[i][2]; var info = markers[i][3]; setTimeout(function(lat, lng, img, info) { console.log(lat + ', ' + lng); $('#map').gmap3({ action: 'addMarker', latLng:[lat, lng], options:{ animation: google.maps.Animation.DROP, icon: img }, events:{ click: function(marker, event, data){ $(this).gmap3({action:'addinfowindow', anchor:marker, options:{content: '<div id=

google map kml implementation

 ̄綄美尐妖づ 提交于 2020-05-12 07:18:07
问题 This is the below code for displaying map according to kml . var myLatLng = new google.maps.LatLng(41.875696, -87.624207); var mapOptions = { zoom: 11, center: myLatLng, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); var ctaLayer = new google.maps.KmlLayer('http://gmaps-samples.googlecode.com/svn/trunk/ggeoxml/cta.kml'); ctaLayer.setMap(map); What i need is using the parse kml to show it on map.I will embed the kml

Load data from JSON file into map markers in Google Maps

安稳与你 提交于 2020-05-11 03:24:50
问题 I've got the following JSON file: { "universities" : [ [ "title": "Aberystwyth University", "web": "www.aber.ac.uk", "phone": "+44 (0)1970 623 111", "lat": 52.415524, "lng": -4.063066 ], [ "title": "Bangor University", "web": "www.bangor.ac.uk", "phone": "+44 (0)1248 351 151", "lat": 53.229520, "lng": -4.129987 ], [ "title": "Cardiff Metropolitan University", "website": "www.cardiffmet.ac.uk", "phone": "+44 (0)2920 416 138", "lat": 51.482708, "lng": -3.165881 ] ] } And I'm trying to load the

Load data from JSON file into map markers in Google Maps

我是研究僧i 提交于 2020-05-11 03:23:49
问题 I've got the following JSON file: { "universities" : [ [ "title": "Aberystwyth University", "web": "www.aber.ac.uk", "phone": "+44 (0)1970 623 111", "lat": 52.415524, "lng": -4.063066 ], [ "title": "Bangor University", "web": "www.bangor.ac.uk", "phone": "+44 (0)1248 351 151", "lat": 53.229520, "lng": -4.129987 ], [ "title": "Cardiff Metropolitan University", "website": "www.cardiffmet.ac.uk", "phone": "+44 (0)2920 416 138", "lat": 51.482708, "lng": -3.165881 ] ] } And I'm trying to load the

Load data from JSON file into map markers in Google Maps

瘦欲@ 提交于 2020-05-11 03:23:08
问题 I've got the following JSON file: { "universities" : [ [ "title": "Aberystwyth University", "web": "www.aber.ac.uk", "phone": "+44 (0)1970 623 111", "lat": 52.415524, "lng": -4.063066 ], [ "title": "Bangor University", "web": "www.bangor.ac.uk", "phone": "+44 (0)1248 351 151", "lat": 53.229520, "lng": -4.129987 ], [ "title": "Cardiff Metropolitan University", "website": "www.cardiffmet.ac.uk", "phone": "+44 (0)2920 416 138", "lat": 51.482708, "lng": -3.165881 ] ] } And I'm trying to load the

How to add markers in react-google-maps?

非 Y 不嫁゛ 提交于 2020-05-10 06:23:12
问题 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:22:40
问题 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:59
问题 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:48
问题 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