google-maps-markers

GMSMarker icon from center (iOS)

北城余情 提交于 2019-12-18 11:41:50
问题 I just switched from Apple Maps to Google Maps. An issue that I can't seem to find an answer to is how do you make the icon for a GMSMarker to start from the center rather then from the bottom of the image. An example of what I mean is the current location dot icon starts centered at the coordinates it is meant to express. However GMSMarkers icons start from the bottom of the icon. 回答1: You can change the start position of your marker icon with the property groundAnchor . Google Maps SDK for

How to change the position of marker from a javascript function?

混江龙づ霸主 提交于 2019-12-18 10:54:31
问题 I have to change the position of a marker on Google map from a javascript function. How can I achieve that? 回答1: You can use setPosition function of the marker class function changeMarkerPosition(marker) { var latlng = new google.maps.LatLng(-24.397, 140.644); marker.setPosition(latlng); } 回答2: First off you must store the marker in an array when you create it so you can have access to it afterwards. Then change the position with marker.setPosition() as solidrevolution mentioned. 回答3: Try

Android google maps marker disable navigation option

断了今生、忘了曾经 提交于 2019-12-18 10:18:30
问题 Im creating an app where users need to walk to a point on a map. But they need to find a route to the point by them selves. Ive created a map with markers but by default if a user clicks on the marker a "start navigation" and "view in google maps" option is shown. Is it possible to disable these options ? The options that are shown on marker click 回答1: This thing is called Map Toolbar. You can disable it by calling UiSettings.setMapToolbarEnabled(false): GoogleMap map; ....... //init map map

Google Map API V3: How to add Custom data to markers

微笑、不失礼 提交于 2019-12-18 10:04:22
问题 Is there a way I can add some custom information to my markers for later use. There are ways to have an info-window and a title, but what If I want to associate the marker with other information. I have other stuff being displayed on the page that depends on the markers so when a marker is click the content on the page has to change depending upon which marker was clicked.I would like store and retrieve the custom data once a marker is lets say clicked etc. Thanks 回答1: As a Google Marker is a

Making a marker carry custom info to be used when clicked (Android, Google Maps v2)

风格不统一 提交于 2019-12-18 09:19:10
问题 I have the following code: public class AlertViewOnMap extends Activity { //declarations ArrayList<String> dateCreatedAtList = new ArrayList<String>(); TextView busNumberTextView; TextView descriptionTextView; TextView alertTimeTextView; DateFormat dateFormat = new SimpleDateFormat("HH:mm"); protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); this.setContentView(com.fourbox.bocterapp.R.layout.details_design);

How to select and deselect a marker in google maps in android?

孤街醉人 提交于 2019-12-18 09:13:22
问题 I have a list of places which are marked in google maps using Markers . I want to select a Marker so that it will highlight with a different color. I have set it using marker.setIcon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_BLUE)) . When I click on the same marker or any other marker I want remove the selection made in the first marker and set it back to the default color. map.setOnMarkerClickListener(new OnMarkerClickListener() { @Override public boolean

GMaps API V3 - Multiple Markers & InfoWindow

落花浮王杯 提交于 2019-12-18 08:58:28
问题 I know, it is a recurrent but... I have a big problem with my multiple markers : all of them have the same title and the same infowindow content. I've searched on many websites, but I didn't find where is the problem in my code. I hope you'll be able to help me (I am sure it is the case !) This is my code : <script type="text/javascript"> var map; var geocoder; $(document).ready(function() { initializeMap(); }); function initializeMap() { var people = [{"userid":"47","lastname":"lastname1",

How to display multiple markers with different icons in Google Maps Android API v2?

只愿长相守 提交于 2019-12-18 06:58:02
问题 I am parsing an XML file which contains the data for my Android Application that will be displayed on a map using the Google Maps Android API v2. The sample format of the XML file is: <markers> <marker name="San Pedro Cathedral" address="Davao City" lat="7.0647222" long="125.6091667" icon="church"/> <marker name="SM Lanang Premier" address="Davao City" lat="7.0983333" long="125.6308333" icon="shopping"/> <marker name="Davao Central High School" address="Davao City" lat="7.0769444" long="125

How to disable marker click event?

我们两清 提交于 2019-12-18 05:40:49
问题 I am developing an simple app, where I already displayed marker title with mrkr.showInfoWindow() but I don't want user to tap again that marker. How to disable clicking event of particular marker ? This is how I tried. Marker marker = gMap.addMarker(new MarkerOptions().position(new LatLng(location .getLatitude(), location.getLongitude())).title("I am here").icon(BitmapDescriptorFactory.fromResource(R.drawable.mrk1))); marker.showInfoWindow(); //how to use marker.setClickable here or somthing

Refreshing makers (ClusterItems) in Google Maps v2 for Android

早过忘川 提交于 2019-12-18 04:10:40
问题 I'm using Google Maps Android API Utility Library and I'm downloading certain images from internet that I want to use as markers. The way I'm doing it is like in the following snippet: class MarkerItemClusterRenderer extends DefaultClusterRenderer<MarkerItem> { ... @Override protected void onBeforeClusterItemRendered(MarkerItem item, final MarkerOptions markerOptions) { super.onBeforeClusterItemRendered(item, markerOptions); mImageLoader.get(item.getImageUrl(), new ImageListener() { @Override