google-maps-api-3

Circle overlay in Google Map V3 API js

 ̄綄美尐妖づ 提交于 2019-12-24 17:15:42
问题 I am trying to insert this circle on a google map, the map displays fine by including the following js file in the header; /** * Called on the intiial page load. */ function initialize() { var latLng = new google.maps.LatLng(50.272213,-5.054973); var options = { 'zoom': 9, 'center': latLng, 'mapTypeId': google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById('map'), options); } // Register an event listener to fire when the page finishes loading. google.maps

show jSON data in google maps marker

我只是一个虾纸丫 提交于 2019-12-24 17:12:55
问题 I want to show several markers in my google maps. Each marker has a pop-up with some informations. I get the information by a database. But I don't get the info in the pop-up: <div id="map-canvas"></div> JavaScript/jQuery: var info = ""; $(function() { $.getJSON("http://server:8080/getInfo", function(data) { $.each(data, function(i, f) { info = "<tr>" + "<td> Info: " + f.address + " / " + f.date + "</td>" + "</tr>"; $(info).appendTo("#info"); }); }); }); var contentString2 = '<div id="content

Google maps API Basic Example

岁酱吖の 提交于 2019-12-24 16:54:33
问题 I've been unable to get the basic Google maps example working on my site. I have the following div on my page: <div id="map_canvas" style="width:100%; height:100%"></div> And the following in the head of my document: <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript"> function initialize() { var latlng = new google.maps.LatLng(-34.397, 150.644); var myOptions = { zoom: 8, center: latlng, mapTypeId: google.maps

Google Maps Directions API - Route not getting plotted for more than 8 waypoints

不羁的心 提交于 2019-12-24 16:51:08
问题 I am trying to draw a route in my project using the Google Maps Directions API but it is not working with waypoints more than 8. var request = { origin: start, destination: end, waypoints: waypts, optimizeWaypoints: true, travelMode: google.maps.TravelMode.DRIVING, key: "our-api-key" } https://developers.google.com/maps/documentation/directions/usage-limits As mentioned in the the usage limits page, we are passing our API key in the request and also have billing enabled with our account. But

stopEventPropagation not working on mobile safari or chrome dev tools emulation

大憨熊 提交于 2019-12-24 16:26:28
问题 Use case; click on marker opens infowindow, click on map closes it. stopEventPropagation is used to prevent that marker click propagates to the map (click on map would close the infowindow), this works fine in chrome, but in mobile safari (iphone 5) or chrome itself emulating the same phone, the event isn't stopped (thus the infobox not shown, or inmediatelly closed). function stopEventPropagation(e) { var evt = e ? e : window.event; evt.cancelBubble = true; if (evt.stop) evt.stop(); if (evt

Google Maps CSS don't show map

ぐ巨炮叔叔 提交于 2019-12-24 16:17:55
问题 I have some problem with adding Google Maps to my project. When i get it into body tags it works. But when I have structure like this <body onload="initialize()"> <div> <div id="map_canvas" style="width:100%; height:100%"></div> </div> </body> it doesn't show anything. How I can solve this problem? 回答1: It is because height: 100%; is always relative to the parent's height. In your case, this is the nameless div, which has zero height, so #map_canvas will be the 100% of that, which is still

How can I create a custom, shareable and colaborative map?

岁酱吖の 提交于 2019-12-24 15:24:40
问题 My situation is this: I have my API code and my website running, then I can load a map, access it from JavaScript and create overlays or functions, but I'm trying to store (save) these custom markers (overlays obtained from script) in a map in a permanent way, but I'm unable to do it as every time I refresh my webpage the markers (and all overlays) disappear and the map reloads without any overlays or any markers, and I don't know how can I solve this. How can I create a custom, shareable and

Google Maps API, How to Get Services (text Search) in Whole City or the whole portion of map that is in view

女生的网名这么多〃 提交于 2019-12-24 14:53:54
问题 When I did a Text Search with var request = { location: placeobject, radius: 50000, query: placetypes // types: placetypes }; infowindow = new google.maps.InfoWindow(); var service = new google.maps.places.PlacesService(map); But All I Get is the chunk of services clogged near the location i send, but how to specify text search to mark all such services in the whole city or a wider region to be searched. Screenshot of what i get is 回答1: You can't get "the whole city". textSearch and

Ionic Google Map API loads occasionally

独自空忆成欢 提交于 2019-12-24 14:51:20
问题 Trying to test an app using the google API with Ionic and for some reason sometimes it will display google maps and sometimes it won't at random. We do not get any error's thrown or any issues, it simply just does not load the google API's map. Controller: .controller('Extra', function($scope, $ionicLoading, $compile) { function initialize() { var myLatlng = new google.maps.LatLng(43.07493,-89.381388); var mapOptions = { center: myLatlng, zoom: 16, mapTypeId: google.maps.MapTypeId.ROADMAP };

jQuery Google Maps - open infowindow on click

时间秒杀一切 提交于 2019-12-24 14:35:13
问题 I am running a google map from HTML data and I really need to be able to click on rows (divs) to open the relevant marker. I was hoping to add an onclick within an .each() function but I cant get anything I have tried to work. Basically if clicking on each row could open the relevant infowindow it would solve all my problems :) Help would be much appreciated. <script type="text/javascript" language="javascript"> var infowindow = new google.maps.InfoWindow(); var myOptions = { zoom: 4, center: