google-maps-api-3

google map api v3 - how to limit number of polygon lines and force closure at the 5 click?

情到浓时终转凉″ 提交于 2019-12-30 11:41:12
问题 i have this code <script> function initialize() { var mapOptions = { center: new google.maps.LatLng(-34.397, 150.644), zoom: 8 }; var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); var drawingManager = new google.maps.drawing.DrawingManager({ drawingMode: google.maps.drawing.OverlayType.MARKER, drawingControl: true, drawingControlOptions: { position: google.maps.ControlPosition.TOP_CENTER, drawingModes: [ google.maps.drawing.OverlayType.POLYGON ] },

Change color multiple marker in google maps API

☆樱花仙子☆ 提交于 2019-12-30 11:39:06
问题 I would like to ask about how to change color of a marker in google maps. The condition is, I have a program to create multiple markers in google maps. But how I can give specified color to each marker? this is my code for now, var markers = []; var map; var labels = 'ABCD'; var labelIndex = 0; function addMarker(location) { var marker = new google.maps.Marker({ position: location, label: labels[labelIndex++ % labels.length], icon: 'http://maps.google.com/mapfiles/ms/icons/green-dot.png' map:

Grouping markers by category to show and hide

落爺英雄遲暮 提交于 2019-12-30 11:13:13
问题 I am adding markers to a google map with the following: function addMarkersToMap(map) { // trigger resize on map in case canvas size is different google.maps.event.trigger(map, 'resize'); // remove existing markers google.maps.Map.prototype.clearMarkers(); // create a new bounds object (don't want existing bounds) var bounds = new google.maps.LatLngBounds(); // If there is a map center, use it to center the map $('.mapCenter').each(function() { var lat = $(this).find('[itemprop="latitude"]')

Jquery google map plugin, adding event listeners

江枫思渺然 提交于 2019-12-30 11:02:14
问题 Can some one explain the meaning of the following code snippet ( jQuery.fn[name] ) found in the google jquery.ui.map plugin: jQuery.each(('click mousedown rightclick dblclick mouseover mouseout drag dragend').split(' '), function(i, name) { jQuery.fn[name] = function(a, b) { return this.addEventListener(name, a, b); }; }); And also how we could bind a callback function to the click event on a map object, I have tried the following but the event does not have the latLng attribute: $('#map

Google Places Autocomplete Can't load search results

两盒软妹~` 提交于 2019-12-30 10:37:08
问题 I am trying to implement the Google Places Autocomplete API sometimes I am able to get location list but sometimes I get "can't load search results" message. Can someone pease help me with the issue. 回答1: This issue have a few possible reasons: No billing account associated to the project If you are still using the old Places SDK If you reach your quota limit(e.g. self imposed cap usage) If your app is not properly restricted If any of the above doesn't fix your issue, it would be best to

Google Maps - Switching between Street View Panorama locations smoothly

China☆狼群 提交于 2019-12-30 08:09:08
问题 I have a simple map proof of concept where, similar to maps.google.com I have a slider at the bottom of the page with street views / panos. When you click on the image it takes you to the same street view. How can I achieve the same kind of transition effect used by google when they transition from one street view to another? Its really smooth avoids a lot of the jerky tile rerendering I'm currently experiencing. Heres the GitHub Repo if it'll help. 回答1: Have you tried maybe making 2 map

Google Maps - Switching between Street View Panorama locations smoothly

感情迁移 提交于 2019-12-30 08:09:03
问题 I have a simple map proof of concept where, similar to maps.google.com I have a slider at the bottom of the page with street views / panos. When you click on the image it takes you to the same street view. How can I achieve the same kind of transition effect used by google when they transition from one street view to another? Its really smooth avoids a lot of the jerky tile rerendering I'm currently experiencing. Heres the GitHub Repo if it'll help. 回答1: Have you tried maybe making 2 map

Javascript select Google markers for all possibilities of checkbox conditions

旧街凉风 提交于 2019-12-30 07:49:46
问题 I am placing markers on a Google map. I have a number of checkboxes (19 currently) in a form that I am trying to create a dynamic "and" condition to display or not display markers. The code works great for the individual pieces when a single checkbox is selected. I would like to have the code take into account if multiple checkboxes are selected and only display those markers that meet all conditions not just add the ones that meet the next condition. Givens: The checkbox ids are "q"+# Each

Javascript select Google markers for all possibilities of checkbox conditions

混江龙づ霸主 提交于 2019-12-30 07:49:20
问题 I am placing markers on a Google map. I have a number of checkboxes (19 currently) in a form that I am trying to create a dynamic "and" condition to display or not display markers. The code works great for the individual pieces when a single checkbox is selected. I would like to have the code take into account if multiple checkboxes are selected and only display those markers that meet all conditions not just add the ones that meet the next condition. Givens: The checkbox ids are "q"+# Each

How to do an Ajax GET request to get data from rails and pass it to javascript(google maps)?

不问归期 提交于 2019-12-30 07:18:11
问题 I have a model Locations with two columns latitude and longitude. I want to find a way where I can get the list of locations and pass them to google maps using Ajax and javascript. So far my code is as follows: map.js: function initialize() { var map; var latlng = new google.maps.LatLng(37.09, -95.71); var options = { zoom: 5, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP, disableDefaultUI: true, disableDoubleClickZoom: true, noClear: true, navigationControl: true,