google-maps-markers

Display Label for Each Waypoint Pin on Google Map API

痞子三分冷 提交于 2019-12-23 09:36:28
问题 I'm trying to add a label for each waypoint along the route, but I'm not quite sure how I should approach it. After doing some research, I understand that you can add a custom pin with label, but that's when I drop each pin manually. How can I do this for direction? 回答1: If you want to get access to markers from DirectionsRenderer request that need a hack because there is not official way to do this from google map api. There is a way around, here is an example I made: https://jsfiddle.net

ArrayIndexOutOfBounds on Android polyline draw

家住魔仙堡 提交于 2019-12-23 09:07:50
问题 I am using google map lite mode version in which i am drawing poly lines and markers on Lenovo K50a40 I m receiving following error **Non-fatal Exception: java.lang.ArrayIndexOutOfBoundsException: length=42; index=42** at maps.ah.k.a(Unknown Source:4000) at maps.ah.k.a(Unknown Source) at maps.ah.k.a(Unknown Source) at maps.ah.i.a(Unknown Source) at maps.ah.d.onDraw(Unknown Source) at android.view.View.draw(View.java:16457) at android.view.View.buildDrawingCacheImpl(View.java:15722) at android

Android maps markers show on map only after zooming change

梦想与她 提交于 2019-12-23 08:08:53
问题 I made simple application where I get markers based on screen coordinates from the server. Problem is that markers doesn't appear on map immediately. User user must zoom in or zoom out only then marker is visible. Why is that? Is it possible to show marker as soon when marker data is downloaded from server? Or is it possible to somehow refresh map? I know that in previous version there was method map.invalidate() that is basically what I need to have now. Unfortunately this method is not

Android maps markers show on map only after zooming change

六月ゝ 毕业季﹏ 提交于 2019-12-23 08:07:07
问题 I made simple application where I get markers based on screen coordinates from the server. Problem is that markers doesn't appear on map immediately. User user must zoom in or zoom out only then marker is visible. Why is that? Is it possible to show marker as soon when marker data is downloaded from server? Or is it possible to somehow refresh map? I know that in previous version there was method map.invalidate() that is basically what I need to have now. Unfortunately this method is not

Marker Visibility In Google Maps

谁说我不能喝 提交于 2019-12-23 06:59:46
问题 I'm building a treasure hunter app and I need to be able to hide a marker and only make it visible at a certain zoom level. How do I achieve this? I'm using a custom marker and google maps v3. Thanks. Oh and what's weird is that I can turn the visibility off at a certain zoom level like in the following code: var marker = new google.maps.Marker({ draggable: false, raiseOnDrag: false, clickable: true, icon: image, shadow: shadow, shape: shape, map: map, url: 'http://www.google.com/', visible:

Google Maps' marker moves when zooming

和自甴很熟 提交于 2019-12-23 05:17:11
问题 I've added a mark to my map but when I zoom in it moves to the left (at maximum zoom in it marks the right place) and when I zoom out it moves to the right (at maximum zoom out it marks like 3000Km from the right place). Here's the class that draws the marker before the onCreate (the image is 62px w x 70px h): class MapOverlay extends com.google.android.maps.Overlay { @Override public boolean draw(Canvas canvas, MapView map, boolean shadow, long when) { super.draw(canvas, map, shadow); Point

How to make a marker appear or disappear based on zoom level on Google Maps v2

谁说胖子不能爱 提交于 2019-12-23 05:11:50
问题 We all know that some of the predefined landmarks on Google Maps does not appear on a lower zoom level, but on a higher zoom level, it suddenly appears. I would like to know If I can make a customized marker not appear at lower zoom levels, then appear at higher ones. EDIT: Here is a snippet of my code. // Changing marker icon marker.icon(BitmapDescriptorFactory.fromResource(R.drawable.gasbig)); // adding marker map.addMarker(marker); //position on Center CameraPosition cameraPosition = new

Google Map with Cluster and Custom view marker lagging too much while zoomIn and zoomOut

倖福魔咒の 提交于 2019-12-23 04:46:00
问题 I want to load GoogleMap with custom view in replace of GMSMarker and want to show clustering and I have done that. But I'm facing lagging & memory usage while zoomIn or ZoomOut the Map. I have load custom view to GMSMarker infoView Here is my code. class InitialMapViewController: UIViewController, GMUClusterManagerDelegate, GMUClusterRendererDelegate { private var clusterManager: GMUClusterManager! @IBOutlet weak var mapView: GMSMapView! override func viewDidLoad() { super.viewDidLoad() self

How can i show markers close to a route path in android maps?

北慕城南 提交于 2019-12-23 04:24:06
问题 I have an application with a map Activity. I also have put some markers on it. I have found in this SO question how to draw a path between 2 points: Answer : Draw path between two points using Google Maps Android API v2 How can i show only those of my markers that are close to this path in a radius for example 500m ? 回答1: You can use the PolyUtil.isLocationOnPath method from the Google Maps Android API Utility Library: Computes whether the given point lies on or near a polyline, within a

How to add a random point inside a polygon in Google Maps?

霸气de小男生 提交于 2019-12-23 03:44:25
问题 I have a bounds to a place and created a polygon of that place. How can I generate a random point inside the bounds of that polygon? 回答1: One way of doing it. This will calculate the bounds of the polygon, then guess a random point inside that bounds, if the point is contained by the polygon, it will put a marker there. // calculate the bounds of the polygon var bounds = new google.maps.LatLngBounds(); for (var i=0; i < polygon.getPath().getLength(); i++) { bounds.extend(polygon.getPath()