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

custom marker icon with react-leaflet

I finally found the correct code for the Icon.js file : import L from ‘leaflet’; const iconPerson = new L.Icon({ iconUrl: require(‘../img/marker-pin-person.svg’), iconRetinaUrl: require(‘../img/marker-pin-person.svg’), iconAnchor: null, popupAnchor: null, shadowUrl: null, shadowSize: null, shadowAnchor: null, iconSize: new L.Point(60, 75), className: ‘leaflet-div-icon’ }); export { iconPerson };

Android map marker color?

Here is a method I am using to generate dynamic Hue colors for markers based on given String color. May be useful for someone 🙂 Marker melbourne = mMap.addMarker(new MarkerOptions().position(MELBOURNE) .icon(getMarkerIcon(“#ff2299”))); // method definition public BitmapDescriptor getMarkerIcon(String color) { float[] hsv = new float[3]; Color.colorToHSV(Color.parseColor(color), hsv); return BitmapDescriptorFactory.defaultMarker(hsv[0]); }

Plot with fewer markers than data points (or a better way to plot CDFs?) [matplotlib, or general plotting help]

You can do plot(x,y,marker=”o”,markevery=5) to mark every fifth point, but I don’t think there is any built-in support for setting marks at even intervals. You could decide on the x locations where you want the marks, use e.g. numpy.searchsorted to find which data points the locations fall between, and then interpolate between the neighboring points … Read more

How to specify the size of the icon on the Marker in Google Maps V2 Android

Currently it’s not possible to specify a marker size using MarkerOptions, so your only option is to rescale your Bitmap before setting it as your marker icon. Creating the scaled Bitmap: int height = 100; int width = 100; BitmapDrawable bitmapdraw = (BitmapDrawable)getResources().getDrawable(R.mipmap.marker); Bitmap b = bitmapdraw.getBitmap(); Bitmap smallMarker = Bitmap.createScaledBitmap(b, width, height, false); Using … Read more

Set Image from drawable as marker in Google Map version 2

This is how you can set a Drawable as a Marker. BitmapDescriptor icon = BitmapDescriptorFactory.fromResource(R.drawable.current_position_tennis_ball) MarkerOptions markerOptions = new MarkerOptions().position(latLng) .title(“Current Location”) .snippet(“Thinking of finding some thing…”) .icon(icon); mMarker = googleMap.addMarker(markerOptions); VectorDrawables and XML based Drawables do not work with this.

How to hide “Navigation” and “GPS Pointer” buttons when I click the marker on the android google map

For the button group you have outlined in red, you can disable it using the setMapToolbarEnabled() method in UISettings. From the documentation: Sets the preference for whether the Map Toolbar should be enabled or disabled. If enabled, users will see a bar with various context-dependent actions, including ‘open this map in the Google Maps app’ … Read more