private void CircleDemo(HuaweiMap hMap) { hMap.Clear(); Circle circle1; LatLng circle1LatLng = new LatLng(41.01019, 28.974475); CircleOptions circle1Options = new CircleOptions(); circle1Options.InvokeCenter(circle1LatLng); circle1Options.InvokeRadius(1600); circle1Options.InvokeStrokeWidth(5); circle1Options.InvokeStrokeColor(Color.Blue); circle1Options.InvokeFillColor(Color.Argb(60, 0, 0, 255)); circle1Options.Clickable(true); circle1Options.InvokeZIndex(2); circle1 = hMap.AddCircle(circle1Options); Circle circle2; LatLng circle2LatLng = new LatLng(41.01563, 29.052667); CircleOptions circle2Options = new CircleOptions(); circle2Options.InvokeCenter(circle2LatLng); circle2Options.InvokeRadius(5000); circle2Options.InvokeStrokeWidth(10); circle2Options.InvokeStrokeColor(Color.OrangeRed); circle2Options.InvokeFillColor(Color.Argb(60, 255, 200, 0)); circle2Options.Clickable(true); circle2Options.InvokeZIndex(1); circle2 = hMap.AddCircle(circle2Options); }
public void OnMapReady(HuaweiMap map) { Log.Debug(TAG, "OnMapReady: "); hMap = map; hMap.MyLocationEnabled = true; hMap.MoveCamera(CameraUpdateFactory.NewLatLngZoom(new LatLng(48.893478, 2.334595), 10)); }
public void OnMapReady(HuaweiMap huaweiMap) { this.hMap = huaweiMap; hMap.UiSettings.ZoomControlsEnabled = true; hMap.UiSettings.CompassEnabled = true; hMap.UiSettings.MyLocationButtonEnabled = true; hMap.MyLocationEnabled = true; // hMap.MapType = HuaweiMap.MapTypeNone; hMap.MarkerClick += OnMarkerClick; hMap.MarkerDragStart += OnMarkerDragStart; hMap.MarkerDrag += OnMarkerDrag; hMap.MarkerDragEnd += OnMarkerDragEnd; hMap.PolylineClick += OnPolylineClick; hMap.PolygonClick += OnPolygonClick; hMap.CircleClick += OnCircleClick; hMap.GroundOverlayClick += OnGroundOverlayClick; hMap.SetInfoWindowAdapter(new CustomMapInfoWindow(this)); Toast.MakeText(this, "OnMapReady done.", ToastLength.Short).Show(); MarkersDemo(hMap); }
public void OnMapReady(HuaweiMap map) { //get map instance in a callback method //Log.d(TAG, "onMapReady: "); hMap = map; hMap.UiSettings.ZoomControlsEnabled = true; hMap.UiSettings.CompassEnabled = true; hMap.UiSettings.MyLocationButtonEnabled = true; hMap.MyLocationEnabled = true; // hMap.MapType = HuaweiMap.MapTypeNone; hMap.MarkerClick += OnMarkerClick; hMap.MarkerDragStart += OnMarkerDragStart; hMap.MarkerDrag += OnMarkerDrag; hMap.MarkerDragEnd += OnMarkerDragEnd; hMap.PolylineClick += OnPolylineClick; hMap.PolygonClick += OnPolygonClick; hMap.CircleClick += OnCircleClick; hMap.GroundOverlayClick += OnGroundOverlayClick; hMap.SetInfoWindowAdapter(new CustomMapInfoWindow(this)); Toast.MakeText(this, "OnMapReady done.", ToastLength.Short).Show(); viewModel.MarkersDemo(hMap, context); }
public void OnMapReady(HuaweiMap map) { Log.Debug(TAG, "OnMapReady: "); hMap = map; hMap.UiSettings.MyLocationButtonEnabled = false; hMap.MoveCamera(CameraUpdateFactory.NewLatLngZoom(new LatLng(48.893478, 2.334595), 10)); // Add a marker on the map. Marker mParis; mParis = hMap.AddMarker(new MarkerOptions().InvokePosition(new LatLng(48.893478, 2.334595)).InvokeTitle("paris").InvokeSnippet("hello")); // Define the animation transparency effect. Huawei.Hms.Maps.Model.Animation.Animation alphaAnimation = new AlphaAnimation(0.2f, 1.0f); alphaAnimation.RepeatCount = 5; alphaAnimation.SetDuration(1000L); alphaAnimation.SetAnimationListener(new AnimationListener()); AnimationSet animationSet = new AnimationSet(true); animationSet.SetInterpolator(new LinearInterpolator()); animationSet.AddAnimation(alphaAnimation); // Set the animation effect for a marker. mParis.SetAnimation(animationSet); // Start the animation. mParis.StartAnimation(); }
public void OnMapReady(HuaweiMap map) { Log.Debug(TAG, "OnMapReady: "); hMap = map; hMap.MyLocationEnabled = true; hMap.ResetMinMaxZoomPreference(); }
public void OnMapReady(HuaweiMap map) { Log.Debug(TAG, "OnMapReady: "); hMap = map; hMap.SetLanguage("en"); hMap.MyLocationEnabled = true; }
public void OnMapReady(HuaweiMap map) { hMap = map; hMap.MoveCamera(CameraUpdateFactory.NewLatLngZoom(latLng1, 13)); AddOriginMarker(latLng1); AddDestinationMarker(latLng2); }
private void PolylineDemo(HuaweiMap hMap) { hMap.Clear(); Polyline polyline1; PolylineOptions polyline1Options = new PolylineOptions() .Add(new LatLng(41.01929, 28.967267), new LatLng(41.016785, 28.986971), new LatLng(41.001917, 28.978743), new LatLng(41.002298, 28.954132)); polyline1Options.InvokeColor(Color.Blue); polyline1Options.InvokeWidth(20); // polyline1Options.InvokeZIndex(2); polyline1Options.Visible(false); polyline1Options.Clickable(true); polyline1 = hMap.AddPolyline(polyline1Options); Polyline polyline2; PolylineOptions polyline2Options = new PolylineOptions() .Add(new LatLng(41.010410, 28.978511), new LatLng(41.035243, 29.026812), new LatLng(41.022122, 29.00653), new LatLng(41.00415, 29.012449), new LatLng(41.001699, 28.978743)); polyline2Options.InvokeColor(Color.Red); polyline1Options.InvokeZIndex(1); polyline2Options.Clickable(true); polyline2 = hMap.AddPolyline(polyline2Options); }
public void OnMapReady(HuaweiMap map) { Log.Debug(TAG, "OnMapReady: "); hMap = map; hMap.MyLocationEnabled = true; hMap.SetInfoWindowAdapter(new CustomInfoWindowAdapter(this)); hMap.MoveCamera(CameraUpdateFactory.NewLatLngZoom(new LatLng(48.893478, 2.334595), 14)); }
public void OnMapReady(HuaweiMap map) { Log.Info(TAG, "OnMapReady: "); hMap = map; hMap.MyLocationEnabled = true; hMap.UiSettings.ZoomControlsEnabled = false; hMap.MoveCamera(CameraUpdateFactory.NewLatLngZoom(new LatLng(48.893478, 2.334595), 10)); }
public void OnMapReady(HuaweiMap map) { Log.Debug(TAG, "OnMapReady: "); hMap = map; hMap.UiSettings.CompassEnabled = true; hMap.MoveCamera(CameraUpdateFactory.NewLatLngZoom(new LatLng(48.893478, 2.334595), 14)); hMap.SetOnMapLongClickListener(this); }
public void OnMapReady(HuaweiMap map) { hMap = map; hMap.SetOnMapClickListener(this); hMap.SetOnMapLongClickListener(this); hMap.SetOnCameraIdleListener(this); hMap.MyLocationEnabled = true; hMap.SetOnMyLocationButtonClickListener(this); }
public void OnMapReady(HuaweiMap hMap) { if (hMap == null) { return; } this.hMap = hMap; hMap.SetInfoWindowAdapter(this); }
public void OnMapReady(HuaweiMap map) { Log.Debug(TAG, "OnMapReady: "); hMap = map; hMap.MyLocationEnabled = false; hMap.UiSettings.CompassEnabled = false; hMap.UiSettings.ZoomControlsEnabled = false; hMap.UiSettings.MyLocationButtonEnabled = false; mUiSettings = hMap.UiSettings; }
public void OnMapReady(HuaweiMap map) { hMap = map; hMap.UiSettings.CompassEnabled = true; hMap.UiSettings.MyLocationButtonEnabled = true; hMap.MapType = HuaweiMap.MapTypeNormal; hMap.MoveCamera(CameraUpdateFactory.NewLatLngZoom(new LatLng(48.893478, 2.334595), 10)); StreamReader strm = new StreamReader(Assets.Open("mapstyle_greeen.json")); string response = strm.ReadToEnd(); var isLoad = hMap.SetMapStyle(MapStyleOptions.LoadAssetResouceStyle(response)); }
public void OnMapReady(HuaweiMap map) { Log.Debug(TAG, "OnMapReady: "); hMap = map; hMap.UiSettings.MyLocationButtonEnabled = false; hMap.MoveCamera(CameraUpdateFactory.NewLatLngZoom(new LatLng(48.893478, 2.334595), 10)); TileProvider mTileProvider = new TileProvider(); TileOverlayOptions options = new TileOverlayOptions().InvokeTileProvider(mTileProvider).InvokeTransparency(0.5f).InvokeFadeIn(true); hMap.AddTileOverlay(options); }
internal void MarkersDemo(HuaweiMap hMap, Context context) { void MarkersDemo(HuaweiMap hMap, Android.Content.Context context) { hMap.Clear(); Marker marker1; MarkerOptions marker1Options = new MarkerOptions() .InvokePosition(new LatLng(41.0083, 28.9784)) .InvokeTitle("Marker Title #1") .InvokeSnippet("Marker Desc #1"); marker1 = hMap.AddMarker(marker1Options); Marker marker2; MarkerOptions marker2Options = new MarkerOptions() .InvokePosition(new LatLng(41.022231, 29.008118)) .InvokeTitle("Marker Title #2") .InvokeSnippet("Marker Desc #2"); marker2 = hMap.AddMarker(marker2Options); Marker marker3; MarkerOptions marker3Options = new MarkerOptions() .InvokePosition(new LatLng(41.005784, 28.997364)) .InvokeTitle("Marker Title #3") .InvokeSnippet("Marker Desc #3"); Bitmap bitmap1 = ResourceBitmapDescriptor.DrawableToBitmap(context, ContextCompat.GetDrawable(context, Resource.Drawable.markerblue)); marker3Options.InvokeIcon(BitmapDescriptorFactory.FromBitmap(bitmap1)); marker3 = hMap.AddMarker(marker3Options); Marker marker4; MarkerOptions marker4Options = new MarkerOptions() .InvokePosition(new LatLng(41.028435, 28.988186)) .InvokeTitle("Marker Title #4") .InvokeSnippet("Marker Desc #4") .Anchor(0.9F, 0.9F) .Draggable(true); Bitmap bitmap2 = ResourceBitmapDescriptor.DrawableToBitmap(context, ContextCompat.GetDrawable(context, Resource.Drawable.marker)); marker4Options.InvokeIcon(BitmapDescriptorFactory.FromBitmap(bitmap2)); marker4 = hMap.AddMarker(marker4Options); } }
public void OnMapReady(HuaweiMap huaweiMap) { Log.Info(TAG, "OnMapReady: "); hMap = huaweiMap; if (IsGPSOpen(this)) { hMap.MyLocationEnabled = true; hMap.UiSettings.MyLocationButtonEnabled = true; } else { hMap.MyLocationEnabled = false; hMap.UiSettings.MyLocationButtonEnabled = false; } hMap.SetOnCameraMoveStartedListener(this); hMap.SetOnCameraIdleListener(this); hMap.SetOnCameraMoveListener(this); hMap.SetOnMapLoadedCallback(this); }
public void OnMapReady(HuaweiMap map) { hMap = map; hMap.MapType = HuaweiMap.MapTypeNormal; hMap.UiSettings.MyLocationButtonEnabled = true; hMap.UiSettings.CompassEnabled = true; hMap.UiSettings.ZoomControlsEnabled = true; hMap.UiSettings.ZoomGesturesEnabled = true; hMap.MyLocationEnabled = true; hMap.MapClick += HMap_MapClick; if (selectedCoordinates == null) { selectedCoordinates = new GeofenceModel { LatLng = CurrentPosition, Radius = 30 } } ; }
private void OverlayDemo(HuaweiMap hMap) { hMap.Clear(); GroundOverlay groundOverlay1; BitmapDescriptor descriptor1 = BitmapDescriptorFactory.FromResource(Resource.Drawable.hmslogo); GroundOverlayOptions groundOverlay1Options = new GroundOverlayOptions() .Position(new LatLng(41.010037, 28.9819363), 2400, 2400) .InvokeImage(descriptor1); groundOverlay1Options.Clickable(true); groundOverlay1 = hMap.AddGroundOverlay(groundOverlay1Options); GroundOverlay groundOverlay2; BitmapDescriptor descriptor2 = BitmapDescriptorFactory.FromResource(Resource.Drawable.maplogo); GroundOverlayOptions groundOverlay2Options = new GroundOverlayOptions() .Position(new LatLng(41.024204, 29.009406), 2400, 2400) .InvokeImage(descriptor2); groundOverlay2Options.Clickable(true); groundOverlay2 = hMap.AddGroundOverlay(groundOverlay2Options); }
public void OnMapReady(HuaweiMap map) { hMap = map; hMap.UiSettings.MyLocationButtonEnabled = true; hMap.MyLocationEnabled = true; addMarker(new LatLng(41.03472222, 28.90027778), "Home", "Home Sweet Home"); Marker marker1; MarkerOptions marker1Options = new MarkerOptions() .InvokePosition(new LatLng(40.985996056, 29.035333192)) .InvokeTitle("Stadium") .InvokeSnippet("Fenerbahce Stadium"); marker1 = hMap.AddMarker(marker1Options); hMap.SetInfoWindowAdapter(new CustomMapInfoWindow(this)); //drawPolygone(); //drawPolyline(); //drawCircle(); }
public void OnMapReady(HuaweiMap map) { Log.Info(TAG, "OnMapReady."); _map = map; _map.UiSettings.ZoomControlsEnabled = true; _map.UiSettings.CompassEnabled = true; if (CheckPermission(Permissions, 202)) { _map.UiSettings.MyLocationButtonEnabled = true; _map.MyLocationEnabled = true; } _map.MapType = HuaweiMap.MapTypeNormal; Toast.MakeText(this, "OnMapReady done.", ToastLength.Short).Show(); _clusterManager = new ClusterManager(this, _map); _map.SetOnCameraIdleListener(_clusterManager); _clusterManager.SetCallbacks(new ClusterManagerCallbacks()); AddRandomClusterItems(_clusterManager); _clusterManager.SetIconGenerator(new CustomIconGenerator(this)); }
public void OnMapReady(HuaweiMap hMap) { if (hMap == null) { return; } Log.Info(TAG, "OnMapReady."); _hMap = hMap; _hMap.MapType = HuaweiMap.MapTypeNormal; _hMap.UiSettings.MyLocationButtonEnabled = true; _hMap.UiSettings.ZoomControlsEnabled = true; _hMap.UiSettings.CompassEnabled = true; _hMap.UiSettings.MyLocationButtonEnabled = true; Toast.MakeText(_context, "OnMapReady done.", ToastLength.Short).Show(); _hMap.MyLocationEnabled = true; LatLng PARIS = new LatLng(48.893478, 2.334595); _hMap.MoveCamera(CameraUpdateFactory.NewLatLngZoom(new LatLng(48.893478, 2.334595), 14)); Marker mParis = _hMap.AddMarker(new MarkerOptions().Position(PARIS).Title("paris").Snippet("hello").Clusterable(true)); }
private void PolygonDemo(HuaweiMap hMap) { hMap.Clear(); Polygon polygon1; PolygonOptions polygon1Options = new PolygonOptions() .Add(new LatLng(41.01929, 28.967267), new LatLng(41.016785, 28.986971), new LatLng(41.014623, 28.999753), new LatLng(41.001917, 28.978743), new LatLng(41.002298, 28.954132)); polygon1Options.InvokeFillColor(Color.Argb(60, 255, 200, 0)); polygon1Options.InvokeStrokeColor(Color.Yellow); polygon1Options.InvokeStrokeWidth(30); polygon1Options.Clickable(true); polygon1Options.InvokeZIndex(2); polygon1 = hMap.AddPolygon(polygon1Options); Polygon polygon2; PolygonOptions polygon2Options = new PolygonOptions() .Add(new LatLng(41.035243, 29.026812), new LatLng(41.022122, 29.00653), new LatLng(41.00415, 29.012449), new LatLng(41.001699, 28.978743), new LatLng(41.017384, 28.986827), new LatLng(41.037711, 28.996791)); polygon2Options.InvokeFillColor(Color.Argb(60, 0, 0, 255)); polygon2Options.InvokeStrokeColor(Color.Blue); polygon2Options.Clickable(true); polygon2 = hMap.AddPolygon(polygon2Options); }
public void OnMapReady(HuaweiMap map) { map.SetOnMapClickListener(pressLocationSource); map.MyLocationEnabled = true; map.SetLocationSource(pressLocationSource); }
public void OnMapReady(HuaweiMap map) { Log.Debug(TAG, "OnMapReady: "); hMap = map; hMap.MoveCamera(CameraUpdateFactory.NewLatLngZoom(new LatLng(48.893478, 2.334595), 10)); HuaweiMapOptions huaweiMapOptions = new HuaweiMapOptions(); var AmbientEnabled = huaweiMapOptions.AmbientEnabled; Log.Debug(TAG, "AmbientEnabled: " + AmbientEnabled.ToString()); huaweiMapOptions.InvokeCamera(hMap.CameraPosition); huaweiMapOptions.InvokeLatLngBoundsForCameraTarget(new LatLngBounds(new LatLng(10, 21), new LatLng(15, 21))); var Camera = huaweiMapOptions.Camera; Log.Debug(TAG, "Camera: " + Camera.ToString()); var CompassEnabled = huaweiMapOptions.CompassEnabled; Log.Debug(TAG, "CompassEnabled: " + CompassEnabled.ToString()); var LatLngBoundsForCameraTarget = huaweiMapOptions.LatLngBoundsForCameraTarget; Log.Debug(TAG, "LatLngBoundsForCameraTarget: " + LatLngBoundsForCameraTarget.ToString()); var LiteMode = huaweiMapOptions.LiteMode; Log.Debug(TAG, "LiteMode: " + LiteMode.ToString()); var MapToolbarEnabled = huaweiMapOptions.MapToolbarEnabled; Log.Debug(TAG, "MapToolbarEnabled: " + MapToolbarEnabled.ToString()); var MapType = huaweiMapOptions.MapType; Log.Debug(TAG, "MapType: " + MapType.ToString()); var MinZoomPreference = huaweiMapOptions.MinZoomPreference; Log.Debug(TAG, "MinZoomPreference: " + MinZoomPreference.ToString()); var RotateGesturesEnabled = huaweiMapOptions.RotateGesturesEnabled; Log.Debug(TAG, "RotateGesturesEnabled: " + RotateGesturesEnabled.ToString()); var ScrollGesturesEnabled = huaweiMapOptions.ScrollGesturesEnabled; Log.Debug(TAG, "ScrollGesturesEnabled: " + ScrollGesturesEnabled.ToString()); var TiltGesturesEnabled = huaweiMapOptions.TiltGesturesEnabled; Log.Debug(TAG, "TiltGesturesEnabled: " + TiltGesturesEnabled.ToString()); huaweiMapOptions.InvokeUseViewLifecycleInFragment(false); var UseViewLifecycleInFragment = huaweiMapOptions.UseViewLifecycleInFragment; Log.Debug(TAG, "UseViewLifecycleInFragment: " + UseViewLifecycleInFragment.ToString()); huaweiMapOptions.InvokeZOrderOnTop(true); var ZOrderOnTop = huaweiMapOptions.ZOrderOnTop; Log.Debug(TAG, "ZOrderOnTop: " + ZOrderOnTop.ToString()); var MaxZoomPreference = huaweiMapOptions.MaxZoomPreference; Log.Debug(TAG, "MaxZoomPreference: " + MaxZoomPreference.ToString()); var ZoomControlsEnabled = huaweiMapOptions.ZoomControlsEnabled; Log.Debug(TAG, "ZoomControlsEnabled: " + ZoomControlsEnabled.ToString()); var ZoomGesturesEnabled = huaweiMapOptions.ZoomGesturesEnabled; Log.Debug(TAG, "ZoomGesturesEnabled: " + ZoomGesturesEnabled.ToString()); var DescribeContents = huaweiMapOptions.DescribeContents(); Log.Debug(TAG, "DescribeContents: " + DescribeContents.ToString()); }