google-maps-markers

Open only one infowindow at a time google maps

南楼画角 提交于 2019-12-01 00:21:34
Im trying to create a google map with multiple markers that allows only one info window at a time. The markers are the locations of IP cameras and they are fetched through ruby. I've read loads of answers to similar questions whereby the solution is to create only one info window and re-use it. I have tried to implement the solutions from a number of other questions but I can't get it to work. $(document).ready(function () { // execute (function () { // map options var options = { zoom: 2, center: new google.maps.LatLng(25, 10), // centered US mapTypeControl: false, streetViewControl: false };

Snap to nearest marker

随声附和 提交于 2019-12-01 00:20:24
i am using GoogleMaps and i have 2 or more markers and they are draggable. I want to snap 2 markers if they are near and merge them into 1. is this possible ? Can someone give me pointers .. how i can realize that ? You need to handle the drag event on the GMarker object. The trick is what do you do when you detect that you are near enough to another marker to snap them together. I played around a little with this and thought maybe hiding the currently dragged marker might be a good way to go. GEvent.addListener(marker, "drag", function(point) { // iterate over your points and for each

How to enable and disable the drawingControlOptions in Google Maps?

谁说我不能喝 提交于 2019-11-30 23:25:39
I am having three different buttons for drawing shapes. Clicking each button the exclusive drawing option should be enabled and also the other options should become disabled. My code is following. drawShape.js File The following is my Javascript code. I am having three separate methods to draw shapes(circle, rectangle, polygon). By the below code, by each click I am getting new drawing controller. Please me to correct it. google.maps.visualRefresh = true; var rectangles = []; var coordinates = []; var polygons = []; var map; function initiateRectangle(){ //Allowing to draw shapes in the Client

Android creating BitmapDescriptor exception

跟風遠走 提交于 2019-11-30 20:58:16
I'm writing an application that works alot with google map and markers on it. My task is to create and display some amount of markers on google map. Markers have custom image and text in it. Data is loading from server and i need to display new amount of data every time user moves google map camera. So i'm using android-maps-utils:0.4.3 library for creating custom Bitmap (using IconGenerator) and then create BitmapDescriptor from it. Here is part of the code: googleMap.clear() LayoutInflater layoutInflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);

Google Maps API V3 -> Utilize MarkerCluster but have the clusters themselves be specific to a drawn polygon/region?

江枫思渺然 提交于 2019-11-30 20:56:47
问题 Ok, let me preface this question with the fact that I have created a lot of google maps, but they have been strictly markers and polylines denoting routes and a couple with some handler interaction. Now I am looking to show basically a map of the world, mostly North America and I want to split this continent into my predefined regions with some lats/lngs that I have. Using these regions I want to draw something like a polygon with a light opacity and different color per region. I then want to

Click Listener for Info Window Google Maps V2

本秂侑毒 提交于 2019-11-30 20:54:19
I have a simple "Place" class: public class Plac{ String name; int id; LatLng latlng; public Product(String name, int id, LatLng latlng) { this.name = name; this.id= id; this.latlng = latlng; } } and I'm adding "Places" to an ArrayList like this: ( Note the names are not unique) ArrayList<Place> places = new ArrayList<Place>(); places.add(new Place("McDonald's", 1)); places.add(new Place("McDonald's", 2)); places.add(new Place("McDonald's", 3)); I'm adding markers to my Google Map like this: for(Place place : places) map.addMarker(new MarkerOptions().position(place.latlng).title(place.name); I

Is it possible to display multiple info windows for multiple markers without tapping it?

和自甴很熟 提交于 2019-11-30 20:50:02
问题 I want to display multiple info window for multiple markers in google map. The info window should display without tapping the marker itself. Is it possible? After researching, I learned that setting the marker as mapview selected marker can make the info window appear without tapping it. However, multiple markers cannot be selected as the selected marker of the mapview at a time. Is there anything that can be done? 回答1: Here is the code to create custom markers as shown in the above image:

Change Google Maps marker icon when clicking on other

*爱你&永不变心* 提交于 2019-11-30 20:17:45
I have created a Google Maps Multiple locations page, using Advanced Custom Fields Google Map field. I have managed to make the marker icon change when clicked on, but I want it to be changed back when clicking on other icons. here is an example of the code: for (i = 0; i < locations.length; i++) { marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map, icon: iconBase + 'Stock%20Index%20Up.png' }); google.maps.event.addListener(marker, 'click', (function(marker, i) { return function() { infowindow.setContent(locations[i][0], locations[i]

Grey area in Google maps

纵饮孤独 提交于 2019-11-30 20:02:58
I have implemented Google maps in my app (in a modal), however as you can see on the images below there is a grey area that I of course want to get rid of. It is possible to move the map so that the grey area disappears, but that shouldn't be needed. Thing is that the map is shown inside a modal box, which contains of a lot of content that's dynamically created when the button for showing the modal is clicked. It seems that the problem could be that the map content isn't fully loaded before the modal is loaded, but I'm not sure... html: ... <div id="myModal" class="modal hide fade" tabindex="

Google Maps JS API (v3) InfoWindow Script Error - JSON Undefined

人走茶凉 提交于 2019-11-30 19:46:34
I've been working on quite a nice program for a month or two now. I'm having an odd issue where clicking a marker on my map is giving a very vague script error. Literally just last night everything was working fine and all of a sudden this is happening. First, here's a brief look at my map. As soon as this form (VB) loads, a list of records is pulled from my SQL Server database. A marker with a unique ID is created for each record. An InfoWindow is made for each marker, and the InfoWindow is filled with details from the columns for that record. I seriously had this part working flawlessly. I