google-maps-markers

creating markers in loop - Infowindow does not open when inside an click Listener

佐手、 提交于 2019-12-01 23:57:57
i have a google map with multiple markers and each has its own infowindow. nothing happens when i click. fyi: i know it the listener fires because i did put a alert in ther before and it worked. Problem Code is: google.maps.event.addListener(point[i], 'click', function() { infowindow[i] = new google.maps.InfoWindow({content: contentString[i] }); infowindow[i].open(map,point[i]); }); if i only do infowindow[i] = new google.maps.InfoWindow({content: contentString[i] }); infowindow[i].open(map,point[i]); it works. but not in my addListener function. i guess ther is something that googlemaps

Capture Google Maps Polyline On Click (Per Start/End)

女生的网名这么多〃 提交于 2019-12-01 22:38:22
Description I am currently working with Google Maps V3 for our client and they've asked us to implement a drawing tool that will allow them to create connected stream of lines and calculate the distance. However, it seems the Google Maps V3 Drawing Manager library is very limited in how it allows us to capture the click events for a polyline. Our Code google.maps.event.addListener(map, 'click', function(event){ //TODO: Store lat/long of click for distance calculation later }); google.maps.event.addListener(drawingManager, 'overlaycomplete', function(e) { //TODO: Display the total distance of

Android Google Maps API String inside the Marker Icon

点点圈 提交于 2019-12-01 21:59:22
问题 Is there a way I can put a value of a String inside the Marker 's icon on Google Maps API 2.0? Like this image in a simple way. Somewhat like this: map.addMarker(new MarkerOptions() .position(POSITION) .title("Your title") .icon(HERE PUT MY VAR STRING) ); 回答1: You can use the Google Maps API Utility Library and customize you markers using bubble icons: IconGenerator iconFactory = new IconGenerator(this); MarkerOptions markerOptions = new MarkerOptions(). icon(BitmapDescriptorFactory

Android Google Maps API String inside the Marker Icon

被刻印的时光 ゝ 提交于 2019-12-01 20:54:47
Is there a way I can put a value of a String inside the Marker 's icon on Google Maps API 2.0? Like this image in a simple way. Somewhat like this: map.addMarker(new MarkerOptions() .position(POSITION) .title("Your title") .icon(HERE PUT MY VAR STRING) ); You can use the Google Maps API Utility Library and customize you markers using bubble icons: IconGenerator iconFactory = new IconGenerator(this); MarkerOptions markerOptions = new MarkerOptions(). icon(BitmapDescriptorFactory.fromBitmap(iconFactory.makeIcon("Your text"))). position(new LatLng(-33.8696, 151.2094)). anchor(iconFactory

Google Maps HeatmapLayer clickable endpoints

守給你的承諾、 提交于 2019-12-01 19:18:31
When a user reaches a zoom level where the cluster only consist of 1-4 LatLng points I would like to make the object clickable to show source of the data used for the heatmap. Any tips on how to address this issue? Can I connect any type of EventListener to the HeatmapLayer points? There is no click-event for a heatmap( basically there isn't any event a heatmap will listen to). What you can do: use a markerClusterer. Create Markers for all points, as markerImage assign a a transparent image(a size of 15x15 should be fine) and apply the desired click-event to the marker. Push the markers into a

Google Maps API: Change marker animation speed

半世苍凉 提交于 2019-12-01 16:58:10
Google Maps API v3 currently supports two types of animation for markers : DROP and BOUNCE Is there a way I can speed up the BOUNCE or slow down the DROP animation? Google Maps API doesn't support animation properties or customization, just the ability to select "drop" or "bounce" as you said. It should be possible to apply custom animations to marker elements through jQuery or other framework. Alternatively you could supply an animated GIF as a marker. 来源: https://stackoverflow.com/questions/6321975/google-maps-api-change-marker-animation-speed

How to center text on android IconGenerator

限于喜欢 提交于 2019-12-01 16:02:39
I'm developing an app using lots of markers placed on the map, and I'm using a custom ClusterRenderer to show them. Problem is that I can't draw the cluster's size in the center of the custom marker icon, please see attached screenshot. I've tried adding contentPadding to the IconGenerator, but still no luck, because of the changing number of digits shown. Could you please help me center the text on the generated icon? Code: IconGenerator clusterIconGenerator = new IconGenerator(context); clusterIcon = context.getResources().getDrawable(R.drawable.map_cluster); clusterIconGenerator

Color variations Polyline property in Google maps API

社会主义新天地 提交于 2019-12-01 12:25:32
问题 I have requirement such that I need to draw a line between Sydney, Melbourne and Adelaide and the line between Sydney and Adelaide should be dark in color and the line between Melbourne and Adelaide should be lighter . Is it possible in current API to provide this functionality in a single object: new google.maps.Polyline({ }); To achieve the functionality? 回答1: One option would be to create google.maps.Polyline object per every line, below is provided the modified example from Simple

Making a Google Maps marker show a specific div when clicked

て烟熏妆下的殇ゞ 提交于 2019-12-01 11:08:14
I'm pretty new to javascript and I'm learning as I go along, so sorry if this is simple. What I have is a bunch of markers displaying on the map, these are loaded from an array and displayed with a function. What I want to do is make a specific div pop up which is related to the marker that was clicked on. When another marker is clicked, that previous div closes and the new div opens up. This is what I have so far , to get a concept of what I'm doing. I imagine I would want to write a function that says... "If 'Marker A' is clicked, open up 'div A' and if 'Marker B' is clicked while 'Marker A'

How to manage click on marker which is not in Cluster in Android Google Map API?

南楼画角 提交于 2019-12-01 11:07:39
I am having trouble implementing OnClickListener for Marker(s) which are not in Cluster, i.e. not added using: mClusterManager.addItem(markerCluster); I have set OnMarkerClickLister as follows: mMap.setOnCameraIdleListener(mClusterManager); mMap.setOnMarkerClickListener(mClusterManager); If I just use: mMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() { @Override public boolean onMarkerClick(Marker marker) { return false; } }); the click on markers is not working at all. For example: I have this situation: Two green dots and big blue dot (with number 6) are one Cluster, but