google maps iOS SDK: custom icons to be used as markers

Here is what I have done let marker = GMSMarker() // I have taken a pin image which is a custom image let markerImage = UIImage(named: “mapMarker”)!.withRenderingMode(.alwaysTemplate) //creating a marker view let markerView = UIImageView(image: markerImage) //changing the tint color of the image markerView.tintColor = UIColor.red marker.position = CLLocationCoordinate2D(latitude: 28.7041, longitude: 77.1025) marker.iconView = markerView … Read more

Display toolbar for Google Maps marker automatically

The overlay that appears when a marker is clicked, is created and destroyed on-the-spot implicitly. You can’t manually show that (yet). If you must have this functionality, you can create an overlay over your map with 2 ImageViews, and call appropriate intents when they’re clicked: // Directions Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse( “http://maps.google.com/maps?saddr=51.5, 0.125&daddr=51.5, … Read more

Is it possible to write custom text on Google Maps API v3?

To show custom text you need to create a custom overlay. Below is an example adapted from official Google documentation. You could also use this library for more “stylish” info windows <html> <head> <script type=”text/javascript” src=”http://maps.google.com/maps/api/js?sensor=false”> </script> <script> //adapded from this example http://code.google.com/apis/maps/documentation/javascript/overlays.html#CustomOverlays //text overlays function TxtOverlay(pos, txt, cls, map) { // Now initialize all … Read more

Add Marker on Android Google Map via touch or tap

Try using new Google Map API v2. It’s easy to use and you can add a marker on tap like this: map.setOnMapClickListener(new GoogleMap.OnMapClickListener() { @Override public void onMapClick(LatLng point) { allPoints.add(point); map.clear(); map.addMarker(new MarkerOptions().position(point)); } }); or in Kotlin: map.setOnMapClickListener { allPoints.add(it) map.clear() map.addMarker(MarkerOptions().position(it)) } Note that you might want to remember all your added … Read more

Google Maps Multiple markers with the exact same location Not working

You need to : create the marker clusterer first. add the markers to the MarkerClusterer (and format your code so it is easier to read…). function createMarker(latlng,text) { var marker = new google.maps.Marker({ position: latlng, map: map }); ///get array of markers currently in cluster var allMarkers = mc.getMarkers(); //check to see if any of … Read more

Change Google Maps marker icon when clicking on other

What duncan said: What you want to do is add all your markers to an array. In your click event handler, loop over that array, updating each marker’s icon. Then finally set the icon for just the marker that’s been clicked. google.maps.event.addListener(marker, ‘click’, (function (marker, i) { return function () { infowindow.setContent(locations[i][0], locations[i][6]); infowindow.open(map, marker); … Read more