google-maps-markers

Click Listener for Info Window Google Maps V2

橙三吉。 提交于 2019-12-30 06:29:28
问题 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:

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

倾然丶 夕夏残阳落幕 提交于 2019-12-30 06:20:27
问题 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

Change the margin color of InfoWindow view of marker in google maps api v2

我怕爱的太早我们不能终老 提交于 2019-12-30 06:12:11
问题 Hello I try to change the default color that have (white) to black, this in the google maps api v2, anyone know how I can do this? PD: is the margin of infowindow this is my code where I change the content of infowindow but need change the margin :S GoogleMap map = .... map.setInfoWindowAdapter(new InfoWindowAdapter() { @Override public View getInfoContents(Marker marker) { View v = getLayoutInflater().inflate( R.layout.info_window_layout, null); v.setBackgroundColor(Color.BLACK); return v; }

Place marker on click google maps javascript api

懵懂的女人 提交于 2019-12-30 05:27:08
问题 I have coded a google map in JS Apis. What I'm trying to achieve is that wherever the user clicks, it places the marker there and outputs its Lat and Lng. What I have achieved is wherever I click, it outputs the Lat and Lng without dragging the marker there. Here the Fiddle - http://jsfiddle.net/sarthakbatra1991/87v0obb4/#&togetherjs=3aTj11AiwO google.maps.event.addListener(map, 'click', function (event) { document.getElementById("lat").value = event.latLng.lat(); document.getElementById(

google maps api marker with label

萝らか妹 提交于 2019-12-30 05:22:27
问题 I have var marker = new MarkerWithLabel({ position: uav.Position, icon: mapStyles.uavSymbolBlack, labelContent: uav.Callsign + '<div style="text-align: center;"><b>Alt: </b>' + uav.Alt + '<br/><b>Bat: </b>' + uav.Battery + '</div>', labelAnchor: new google.maps.Point(95, 20), labelClass: "labels", labelStyle: { opacity: 0.75 }, zIndex: 999999,}) This marker in my JavaScript file, but java console keep giving me an error. Uncaught ReferenceError: MarkerWithLabel is not defined I thought

How to add CSS-Class to a GoogleMaps marker?

和自甴很熟 提交于 2019-12-30 03:48:07
问题 I want to animate (fadein, fadeout) a marker in my GoogleMaps application (Web). How can i assign any css class to a marker? Or how can i access the specific marker? Do they have selectors like :after or something? If not, whats the easiest way of applying animations to them? 回答1: The DOMNode that contains the image used for the marker isn't available via the API. Furthermore, by default the markers will not be single DOMNodes, they will be drawn via canvas. But the Marker-Image may be

How to handle multiple markers on Google Maps with same location?

爷,独闯天下 提交于 2019-12-29 18:43:11
问题 I use Google Maps in an app and it is likely that multiple markers are attached to same location where each marker represent a person. In this situation user will not know that there are other markers/persons behind this particular marker. I looked around to handle this situation and one question on SO suggests that I can display a single marker and associate all persons with that single marker. When user taps that marker I should display a list of all the user associated with that marker.

infoWindow's image not showing on first click, but it works on second click

旧巷老猫 提交于 2019-12-29 09:29:13
问题 My android using the Google map android API,InfoWindow's image not showing on first click, but it works on second click I customize the infoWindow using void setMapInfoWindow(){ mMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() { @Override public View getInfoWindow(Marker arg0) { return null; } @Override public View getInfoContents(Marker arg0) { View v = getLayoutInflater().inflate(R.layout.windowlayout, null); final ImageView img = (ImageView)v.findViewById(R.id.imageView3); /

How to make a dashed curved polyline in Google Maps JS API?

此生再无相见时 提交于 2019-12-29 08:58:13
问题 I have a created a dashed polyline, and a curved polyline, can I make the dashed line curve, or the curved line dashed? http://jsfiddle.net/stevenmc/re6km2wp/ var map; var curvature = 0.5; // how curvy to make the arc function init() { var Map = google.maps.Map, LatLng = google.maps.LatLng, LatLngBounds = google.maps.LatLngBounds, Marker = google.maps.Marker, Point = google.maps.Point; // This is the initial location of the points // (you can drag the markers around after the map loads) var

How can i capture the click event when a default marker/place is clicked on googlemaps?

旧时模样 提交于 2019-12-29 08:37:17
问题 I am working with Google Maps API V3. The googlemaps displays markers for some places/location by default, I need to capture the click event when one of them is clicked.. I have tried to use the click event of the map but it not works because the user is clicking the marker not the map, code is given: google.maps.event.addListener(mymap, 'click', function () { alert('clicked'); }); Can someone give me an idea how to do it? EDIT: I can find no suitable Event in the available Events, which can