google-maps-api-3

Convert (x, y) pixel coordinates in google.maps.Point

随声附和 提交于 2020-02-22 12:25:35
问题 I am trying to find out the LatLng based on my x,y pixel coordinates (and of course map options, such as zoom and center). In order to do so, I posted another question and someone came up with this solution, from this post: /** * @param {google.maps.Map} map * @param {google.maps.Point} point * @param {int} z * @return {google.maps.LatLng} */ var pointToLatlng = function(map, point, z){ var scale = Math.pow(2, z); var normalizedPoint = new google.maps.Point(point.x / scale, point.y / scale);

Convert (x, y) pixel coordinates in google.maps.Point

◇◆丶佛笑我妖孽 提交于 2020-02-22 12:19:52
问题 I am trying to find out the LatLng based on my x,y pixel coordinates (and of course map options, such as zoom and center). In order to do so, I posted another question and someone came up with this solution, from this post: /** * @param {google.maps.Map} map * @param {google.maps.Point} point * @param {int} z * @return {google.maps.LatLng} */ var pointToLatlng = function(map, point, z){ var scale = Math.pow(2, z); var normalizedPoint = new google.maps.Point(point.x / scale, point.y / scale);

googlemaps distance_matrix Creating a Matrix of Results

…衆ロ難τιáo~ 提交于 2020-02-15 06:48:06
问题 So I am trying to do a project for work where I create a matrix where the x-axis is a list of stores and the y axis is another list of stores and the values are the distances returned see the link below for an example of what im looking for Example Output This is the code I am running with dummy addresses for lst_stores1 and lst_stores2 INPUT: import googlemaps lst_store1 = ['777 Brockton Avenue, Abington MA 2351', '30 Memorial Drive, Avon MA', '250 Hartford Avenue, Bellingham MA', '700 Oak

encoding not latin characters google map marker information

点点圈 提交于 2020-02-08 07:02:45
问题 I'm using Google map API to add markers and add information to them but the problem is with the Arabic characters it's displayed like strange symbols though page encoding is utf-8 var locations = [ ['<div class="content" style="dir:rtl; text-align:right;">'+ '<div id="siteNotice">'+ '</div>'+ '<h1 id="firstHeading" class="firstHeading"><?= "المنزل الأول" ?></h1>'+ '<div id="bodyContent">'+ '<p>العنوان بالتفصيل, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+

encoding not latin characters google map marker information

心不动则不痛 提交于 2020-02-08 07:01:06
问题 I'm using Google map API to add markers and add information to them but the problem is with the Arabic characters it's displayed like strange symbols though page encoding is utf-8 var locations = [ ['<div class="content" style="dir:rtl; text-align:right;">'+ '<div id="siteNotice">'+ '</div>'+ '<h1 id="firstHeading" class="firstHeading"><?= "المنزل الأول" ?></h1>'+ '<div id="bodyContent">'+ '<p>العنوان بالتفصيل, <a href="https://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+

Realign Google Maps to fit all markers into to the right 70% of the map

六眼飞鱼酱① 提交于 2020-02-08 03:19:24
问题 I would like to provide a client with a solution for displaying all of the branches in one city on a map (Google Maps JavaScript API). The map behaves more like an in-website app than a typically Google Map - it is not draggable, zoomable, and so on. I put together a tiny function that handles repositioning of the map to have all markers in the maps viewport. This function is called on pageload and everytime the window is resized. While this works perfectly, I need to fine-tune this script

google maps javascript api v3 places library doesn't return any results for the bounds

旧街凉风 提交于 2020-02-07 04:42:56
问题 I am trying to use the places library to display markers between two coordinates using the LatLngBounds class. I am able to see a few markers if I comment out the name attribute which is starbucks in the places search request.Can someone please guide me with the following: 1) Currently the markers I see are in the middle of the two coordinates and not evenly distributed along the bounds which I assume creates a rectangle in which you must see them. I think the markers are just being

google maps javascript api v3 places library doesn't return any results for the bounds

不问归期 提交于 2020-02-07 04:42:01
问题 I am trying to use the places library to display markers between two coordinates using the LatLngBounds class. I am able to see a few markers if I comment out the name attribute which is starbucks in the places search request.Can someone please guide me with the following: 1) Currently the markers I see are in the middle of the two coordinates and not evenly distributed along the bounds which I assume creates a rectangle in which you must see them. I think the markers are just being

Google Maps - cannot read property '__e3_' of undefined

对着背影说爱祢 提交于 2020-02-06 04:01:08
问题 I hope somebody can help me with my Google Maps API code. I have set up a map with multiple markers which works successfully, however I want to add on-click events to the markers so that an info window appears, this is where I hit the problem. $(document).ready(function() { var script = document.createElement("script"); script.type = "text/javascript"; script.src = "http://maps.googleapis.com/maps/api/js?libraries=geometry&sensor=true&callback=mapInitialize"; document.body.appendChild(script)

Major Google Maps glitch using API V3

£可爱£侵袭症+ 提交于 2020-02-06 03:58:27
问题 edit: this is now solved, see my answer below The situation: User clicks on a map-image google maps API V3 is loaded via ajax the map is shown in a dialog window / lightbox What happens: The map displays and all functionality works however there's a glitch with the top-left 'square' of the map. I'm stuck! edit: now with code: <div id="map_canvas"></div> <script type="text/javascript"> $(function() { var latlng = new google.maps.LatLng(51.448359,-2.590559); var options = { zoom: 13, center: