google-maps-api-3

Maps API v3: New InfoWindow, with pixelOffset, w/ data from KML.

二次信任 提交于 2020-01-13 18:09:35
问题 Hello: I'm making progress on my Google Map (see my previous post: KML markers missing on Google Maps API v3: What's wrong?), but I'm now stuck, and hoping for help. My custom-styled map pulls from a KML file with about 20 Placemarks. For design reasons, I want my Placemarks to open on the RIGHT side of the anchor, rather than the default top/center. I've tried searching in vain for a simple way to do this; closest I've come is: Issue with infowindows remaining active when another KML layer

Google Maps differences between async loading and general script tag

我的梦境 提交于 2020-01-13 18:05:27
问题 In an attempt to load google maps asynchronously I took a look at google's async page Essentially I am looking for an alternative to document.write in the API and according to some users on this google group post Using the async version will handle this scenario. My question is why would this script: <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&sensor=SET_TO_TRUE_OR_FALSE" type="text/javascript"></script> Be any different than: var script = document.createElement(

Add infowindow to looped array of markers on google map using api v3

北慕城南 提交于 2020-01-13 17:10:29
问题 I have an array that is being looped through in js to put custom markers on a google map. I need to add a hidden info window for each marker so that when it is clicked the relevant infowindow is displayed. Currently I am doing the following: for(var i=0; i<google_map_item.length; i++) { latlon = new google.maps.LatLng(google_map_item[i].lat, google_map_item[i].lon) bounds.extend(latlon); var iconcolor = google_map_item[i].iconColor; marker = new google.maps.Marker({ map: map, position: latlon

populating google maps markers using ajax

百般思念 提交于 2020-01-13 16:25:08
问题 I'm trying to put about 120 marker on a Google Map using ajax populated array of google.maps.LatLng objects here's my script <script type ="text/javascript"> $.ajaxSetup({ cache: false }); var gMapsLoaded = false; var latlng = []; var returnValue; var marker; var xmlDoc; $.ajax({ type: "POST", url: "map.aspx/getLatLng", data: '{}', contentType: "application/json; charset=utf-8", dataType: "json", success: function (response) { xmlDoc = $.parseXML(response.d); $(xmlDoc).find("Table").each

Best solution for too many pins on google maps

亡梦爱人 提交于 2020-01-13 12:12:35
问题 Here is my Google Maps "Setup" I read from database the locations of all markers (under 300) - sent those into javascript as Json On javascript i parse the json, look trough marker array and create a new google.maps.Marker. For each marker i add an event for clicl that will open a infobox (infoBox.js) with a main picture and some custom details. After that i create clusters( using MarkerClusterer) and everything works well (at least for 3-400 markers) I want to expand and display up to 10k of

Allow Further Zoom on Google Maps v3 Satellite View

主宰稳场 提交于 2020-01-13 09:13:11
问题 I have some very high resolution aerial imagery that I would like to display over a satellite view base map. My imagery is good enough to generate images up to zoom level 23. However, Google's satellite view only allows zooming in to level 20. I know that I can manually switch the map type to my custom overlay once the user zooms in to level 20 (so only my map type is shown), but then I lose the Google imagery for a full zoom level. My question is, is there some way to register for an event

Remove all features from data layer

﹥>﹥吖頭↗ 提交于 2020-01-13 08:07:09
问题 I used something like: var map; function initialize() { map = new google.maps.Map(document.getElementById('map-canvas'), { zoom: 4, center: {lat: -28, lng: 137.883} }); map.data.loadGeoJson('https://storage.googleapis.com/maps-devrel/google.json'); } google.maps.event.addDomListener(window, 'load', initialize); to load a geojson shape file to the map.data layer of my map. In the shape file, there are a couple of 'feature' classes defining polygons to be drawn on the map. Up until here I have

Remove all features from data layer

亡梦爱人 提交于 2020-01-13 08:06:56
问题 I used something like: var map; function initialize() { map = new google.maps.Map(document.getElementById('map-canvas'), { zoom: 4, center: {lat: -28, lng: 137.883} }); map.data.loadGeoJson('https://storage.googleapis.com/maps-devrel/google.json'); } google.maps.event.addDomListener(window, 'load', initialize); to load a geojson shape file to the map.data layer of my map. In the shape file, there are a couple of 'feature' classes defining polygons to be drawn on the map. Up until here I have

add padding to google maps bounds.contains()

不问归期 提交于 2020-01-12 10:28:28
问题 I have a sidebar which shows the names of the markers in the current map view of a google map. The sidebar contents change as the map gets moved: google.maps.event.addListener(map, 'bounds_changed', function() { document.getElementById("list").innerHTML = ""; var mklen = mkrs.length, a = 0, bnds = map.getBounds(); for (a; a < mklen; a++) { var themk = mkrs[a]; if (bnds.contains(themk.getPosition())) { var myli = document.createElement("li"); myli.innerHTML = themk.title; document

Google Maps Javascript API Doesn't Respond to Touch Events in iOS 10

心不动则不痛 提交于 2020-01-12 08:05:32
问题 I run a website with a number of custom Google Maps built in (showing various locations on a map after a search or generating directions to/from a location). I use Google Maps Javascript API for this. My users have started reporting that on iOS 10, these maps no longer respond to touch events -- they cannot pinch-to-zoom nor can they click on the "pins" on the map to open the location info balloons. I've been searching all over for others who have had this issue to no avail. I found one