use of com.google.android.libraries.maps.model.CircleOptions in project android-samples by googlemaps.
the class TagsDemoActivity method addObjectsToMap.
private void addObjectsToMap() {
// A circle centered on Adelaide.
mAdelaideCircle = mMap.addCircle(new CircleOptions().center(ADELAIDE).radius(500000).fillColor(Color.argb(150, 66, 173, 244)).strokeColor(Color.rgb(66, 173, 244)).clickable(true));
mAdelaideCircle.setTag(new CustomTag("Adelaide circle"));
// A ground overlay at Sydney.
mSydneyGroundOverlay = mMap.addGroundOverlay(new GroundOverlayOptions().image(BitmapDescriptorFactory.fromResource(R.drawable.harbour_bridge)).position(SYDNEY, 700000).clickable(true));
mSydneyGroundOverlay.setTag(new CustomTag("Sydney ground overlay"));
// A marker at Hobart.
mHobartMarker = mMap.addMarker(new MarkerOptions().position(HOBART));
mHobartMarker.setTag(new CustomTag("Hobart marker"));
// A polygon centered at Darwin.
mDarwinPolygon = mMap.addPolygon(new PolygonOptions().add(new LatLng(DARWIN.latitude + 3, DARWIN.longitude - 3), new LatLng(DARWIN.latitude + 3, DARWIN.longitude + 3), new LatLng(DARWIN.latitude - 3, DARWIN.longitude + 3), new LatLng(DARWIN.latitude - 3, DARWIN.longitude - 3)).fillColor(Color.argb(150, 34, 173, 24)).strokeColor(Color.rgb(34, 173, 24)).clickable(true));
mDarwinPolygon.setTag(new CustomTag("Darwin polygon"));
// A polyline from Perth to Brisbane.
mPolyline = mMap.addPolyline(new PolylineOptions().add(PERTH, BRISBANE).color(Color.rgb(103, 24, 173)).width(30).clickable(true));
mPolyline.setTag(new CustomTag("Perth to Brisbane polyline"));
}
use of com.google.android.libraries.maps.model.CircleOptions in project android-maps-utils by googlemaps.
the class HeatmapsPlacesDemoActivity method startDemo.
@Override
protected void startDemo(boolean isRestore) {
EditText editText = findViewById(R.id.input_text);
editText.setOnEditorActionListener((textView, actionId, keyEvent) -> {
boolean handled = false;
if (actionId == EditorInfo.IME_ACTION_GO) {
submit(null);
handled = true;
}
return handled;
});
mCheckboxLayout = findViewById(R.id.checkboxes);
GoogleMap map = getMap();
if (!isRestore) {
map.moveCamera(CameraUpdateFactory.newLatLngZoom(SYDNEY, 11));
}
// Add a circle around Sydney to roughly encompass the results
map.addCircle(new CircleOptions().center(SYDNEY).radius(SEARCH_RADIUS * 1.2).strokeColor(Color.RED).strokeWidth(4));
}
use of com.google.android.libraries.maps.model.CircleOptions in project google-maps by capacitor-community.
the class CapacitorGoogleMaps method addCircle.
@PluginMethod()
public void addCircle(final PluginCall call) {
final int radius = call.getInt("radius", 0);
final JSONObject center = call.getObject("center", new JSObject());
getBridge().executeOnMainThread(new Runnable() {
@Override
public void run() {
CircleOptions circleOptions = new CircleOptions();
circleOptions.radius(radius);
try {
circleOptions.center(new LatLng(center.getDouble("latitude"), center.getDouble("longitude")));
} catch (JSONException e) {
e.printStackTrace();
}
googleMap.addCircle(circleOptions);
call.resolve();
}
});
}
Aggregations