google-maps-api-3

Google Maps API rotate Rectangle

帅比萌擦擦* 提交于 2020-01-02 11:09:26
问题 I have an application which draws an array of rectangle on Google Maps using JavaScript API version 3. This works, but what I would like to do is rotate or skew each Rectangle based on user input. Is the Rectangle object limited to horizontal/ vertical lines? The API only takes two corner points as location so I don't see any way to rotate this type of shape. Do I in fact have to change the shape type to Polygon ? 回答1: Do I in fact have to change the shape type to Polygon? Yes since google

Finding nearest city like oodle.com

余生长醉 提交于 2020-01-02 10:05:22
问题 So, I am trying to develop an application that will display user listings. The site should detect user location (I am using maxmind api for that) and then show listsings from user's location + cities within a user-specified radius. How do I do this? MaxMind API lets me detect user's city by IP address but how do I find nearby cities? Reference site: www.oodle.com (you can also manually change city+radius). Sanguine 回答1: Rather than store and compare cities, store and compare latitudes and

Alamofire with google geocoding api

痴心易碎 提交于 2020-01-02 09:10:51
问题 In one of my apps I need to geocode address string. At first I considered using CLGeocoder . However, after I tried it I stumbled upon a problem which I described in this question. The solution was to use Google's Geocoding APIs instead. I have now switched to them and managed to get them working by having the following functions: func startConnection(){ self.data = NSMutableData() let urlString = "https://maps.googleapis.com/maps/api/geocode/json?address=\(searchBar.text!)&key=MYKEY" let

Resize the infoWindow box Google Maps API v3

ε祈祈猫儿з 提交于 2020-01-02 08:57:47
问题 The default infoWindow size is way too big for me. I want it to be much smaller can I can't figure out how to do it. I've tried setting a maxWidth parameter on my infoWindow constructor like this var infowindow = new google.maps.InfoWindow({'maxWidth':'10px'}); and setting the CSS width like this <style type="text/css"> #infoWindow { width: 10px; } </style> but that only seems to change the size of the text wrapping, not the actual box. How do I change the size of the infoWindow box? Here is

Google Maps API v3 Places Library returning undefined utc_offset

十年热恋 提交于 2020-01-02 07:58:40
问题 I'm developing a time and location aware application and the google maps v3 api places library has almost everything I need. However, when doing a textSearch() for specific addresses, and attempting to call getDetails() for one of the returned PlaceResult items, the PlaceResult.utc_offset property returned from getDetails() is undefined (all the other PlaceResult properties I need are returned fine, just not the utc_offset). It's strange, because if I do a textSearch() for a generic term like

Google maps link produces slightly moved marker when opened with native iphone/android app

£可爱£侵袭症+ 提交于 2020-01-02 07:23:11
问题 I am building a web app which contains a Google Maps link that can be opened by the native phone Maps app (iPhone/Android). The link has the form: http://maps.google.com/?q="+startCooLat+','+startCooLng; and I have also tried the: http://maps.google.com/?q=loc:"+startCooLat+'+'+startCooLng; However in the native app the marker is positioned in the nearest street and not in the exact coordinates that I am giving. Is there a solution or another parameter to set so as to overcome this issue? 回答1

Resource interpreted as Script but transferred with MIME type image/png

允我心安 提交于 2020-01-02 06:53:20
问题 Today, all of a sudden I started obtaining the following response in my development website: Refused to execute script from 'https://mts1.googleapis.com/vt?pb=!1m4!1m3!1i8!2i68!3i120!1m4!1m3!1i8!2i68!…12m1!1e47!12m3!1e37!2m1!1ssmartmaps!4e3&callback=_xdc_._pk356f&token=37643' because its MIME type ('image/png') is not executable, and strict MIME type checking is enabled. This causes the tiles to not be loaded properly and its bugging the website. I've read and searched and found nothing

google maps api v3: add point on polyline between two existing points on click polyline event

让人想犯罪 __ 提交于 2020-01-02 05:25:33
问题 How can I add point on a polyline between two existing points on a click polyline event? Thank you! 回答1: If you are just talking about a Polyline with only 2 points, you could use the center of a LatLngBounds containing the Polyline . Google maps api v3 doesn't implement the Polyline.getBounds() function, though. So you can extend the Polyline class to include a getBounds function: google.maps.Polyline.prototype.getBounds = function() { var bounds = new google.maps.LatLngBounds(); this

Uncaught TypeError: Cannot read property '__e3_' of null

落爺英雄遲暮 提交于 2020-01-02 05:19:11
问题 I'm getting the error Uncaught TypeError: Cannot read property '__e3_' of null randomly when dragging a polygon inside a google map. I mean, most of the times when I drag the polygon works as expected, but rarely a few times fails. In the Google Chrome console, the error shown is: 1) Error header: Uncaught TypeError: Cannot read property '__e3_' of null js?libraries=drawing,geometry:87 2) Error body: _.I.hasListeners @ js?libraries=drawing,geometry:87 _.I.trigger @ js?libraries=drawing

Ground Overlay with Transparency

有些话、适合烂在心里 提交于 2020-01-02 04:52:06
问题 I have an online map that contains a ground-overlay image, and would like to make the image semi-transparent so that the base map will show through. Is it possible to add a transparency value to this overlay? http://www.tpwd.state.tx.us/fishboat/fish/recreational/lakes/ingulf1c.phtml Here's the code for the ground overlay: var imageBounds = new google.maps.LatLngBounds( new google.maps.LatLng(25.71438633861514, -98.33555959121725), new google.maps.LatLng(30.40813339247205, -93.57953893270167)