google-maps-markers

Android, How to remove all markers from Google Map V2?

房东的猫 提交于 2019-11-28 22:02:26
问题 I have map view in my fragment. I need to refresh map and add different markers based on condition. So, I should remove last markers from map before add new markers. Actually, some weeks ago app was working fine and suddenly it happened. My code is like this: private void displayData(final List<Venue> venueList) { // Removes all markers, overlays, and polylines from the map. googleMap.clear(); . . . } Last time it was working fine (before new Google Map API announce by Android team in I/O

Maps API v2 with different marker actions

你离开我真会死。 提交于 2019-11-28 21:58:37
问题 I'm trying to port my application to the new Google Maps API v2, but i'm having trouble when interacting with markers. My context: I have a map showing buses and buses stop. With the old library I had my own ItemizedOverlay for bus stops and another one for buses. Each one had a different OnTapListener (actually I use an external library to show balloons), so when the user taps the bus marker nothing happens, but when he taps the bus stop marker an activity with its information is opened.

Is there a way to set the bounds and Zoom level in AGM Map?

一曲冷凌霜 提交于 2019-11-28 21:22:22
问题 I am using AGM maps for my angular 4 application, there I am facing issues, I will be having the multiple markers which are fetched from api as an array of Latitude and Longitude. I want to set the zoom level exactly covering all the markers on the map. Even if one marker in one country and other in some other country also, It should set the zoom level on load to show all the markers on the map. Is there a way to do that in AGM angular maps? Could anyone please help me 回答1: Objectives We

Google Maps API v2 Android add shape drawable as marker

时光毁灭记忆、已成空白 提交于 2019-11-28 21:09:11
I've been trying to add a shape drawable as the marker icon for a marker I want to add on the map. shape looks like this (res/drawable/blue_circle.xml): <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" > <size android:width="15dp" android:height="15dp" /> <solid android:color="@color/Blue" /> </shape> and I try to add the marker like this: markerOptions.icon(BitmapDescriptorFactory.fromResource(R.drawable.blue_circle)); Apparently I get a NullPointer exception. Must the marker icon be a bitmap? Am I allowed to add

Google android maps api v2 Show Marker Title Always

泪湿孤枕 提交于 2019-11-28 21:06:26
I have a google maps v2 in my android application and some markers on it. When user click one of these markers, a title popup comes. How can I show these titles always without user click? Just call Marker.showInfoWindow(); . See https://developers.google.com/maps/documentation/android/marker#info_windows and https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/model/Marker#showInfoWindow() José De la O Something like that: googleMap.addMarker(new MarkerOptions() .position(new LatLng(latitude, longitude)) .title("Your position")).showInfoWindow();

How do you create a Marker with a custom icon for google maps API v3?

假装没事ソ 提交于 2019-11-28 19:37:24
I've been reading https://developers.google.com/maps/documentation/javascript/overlays for a while now and I can't seem to get a custom icon for my map working. Here is my javascript: var simplerweb = new google.maps.LatLng(55.977046,-3.197118); var marker; var map; function initialize() { var myOpts = { center: simplerweb, zoom: 15, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas"), myOpts); marker = new google.maps.Marker({ map: map, draggable: true, animation: google.maps.Animation.DROP, position: simplerweb }); google.maps.event

Android Google Map - Clicked marker opens new activity or bigger window

痴心易碎 提交于 2019-11-28 19:20:32
I've been searching for help on implementing OnMarkerClickListener but nothing I've found has worked. This is my marker below and when clicked it only changes colour(light blue). I'm looking for it to open a bigger window so I can put in more info. Is this possible? googlemap.addMarker(new MarkerOptions() .position(new LatLng(49.378,-0.3904)) .title("Hello World") .snippet("This is my test app") .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_ORANGE))); The marker works fine above on my Map but now I would like to click on the marker and for it to open a new activity

Showing many markers in Google Maps

给你一囗甜甜゛ 提交于 2019-11-28 18:47:48
I have this map and want to display a whole bunch of markers. But I need to find a way of showing this in an orderly fashion, and well... something cool would be nice. Good thing is that Google Maps has many cool features. But I am new to its use and most likely not aware of cool options to organize markers and content. I just stumbled upon one neat way, which I will post below. But in order to learn about solutions that others have found / created, my question is: what are cool ways of showing a large group of markers? Here is the documentation for MarkerClusterer for Google Maps V3 checkout

How to move a marker in Google Maps API

馋奶兔 提交于 2019-11-28 18:35:33
I'm using the Google Maps API V3 and I'm trying to make a marker move across the screen. Here's what I have: <!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0; padding: 0 } #map_canvas { height: 100% } </style> <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"> </script> <script type="text/javascript"> function initialize() { var myLatLng = new google.maps.LatLng(50,50); var myOptions = { zoom: 4, center: myLatLng, mapTypeId:

Android maps utils cluster icon color

蹲街弑〆低调 提交于 2019-11-28 18:22:47
Is there any method to change the background color of the cluster item? (the one that displays the count of the markers, like 100+, 200+ ...). I tried to look into the source code of the ClusterManager but could not find any option to change the color, but maybe someone here knows how to do that. I basically want to "materialify" those colors a bit. I was able to get a rough implementation working by using this demo from the library samples as a guide. I used the lens icon from the Material Design Icons from here . After downloading the lens zip I put ic_lens_black_24dp.png under the drawable