Exemple #1
0
    void OnMapReady()
    {
        Debug.Log("Map is ready: " + _map);
        _map.SetPadding(0, 0, 0, 0);

        var isStyleUpdateSuccess = _map.SetMapStyle(customStyleJson.text);

        if (isStyleUpdateSuccess)
        {
            Debug.Log("Successfully updated style of the map");
        }
        else
        {
            Debug.LogError("Setting new map style failed.");
        }

#if UNITY_2018_3_OR_NEWER && PLATFORM_ANDROID
        if (!Permission.HasUserAuthorizedPermission(Permission.FineLocation))
        {
            Permission.RequestUserPermission(Permission.FineLocation);
        }
#endif

        // UNCOMMENT if testing with showing users location. DON'T FORGET MANIFEST LOCATION PERMISSION!!!
        _map.IsMyLocationEnabled = true;
        _map.UiSettings.IsMyLocationButtonEnabled = true;
        _map.OnOrientationChange += () => { _map.SetRect(RectTransformToScreenSpace(rect)); };

        _map.SetOnCameraMoveStartedListener(moveReason => Debug.Log("Camera move started because: " + moveReason));
        _map.SetOnCameraIdleListener(() => Debug.Log("Camera is now idle"));
        _map.SetOnCircleClickListener(circle => Debug.Log("Circle clicked: " + circle));
        _map.SetOnPolylineClickListener(polyline => Debug.Log("Polyline clicked: " + polyline));
        _map.SetOnPolygonClickListener(polygon => Debug.Log("Polygon clicked: " + polygon));
        _map.SetOnMarkerClickListener(marker => Debug.Log("Marker clicked: " + marker), false);
        _map.SetOnInfoWindowClickListener(marker => Debug.Log("Marker info window clicked: " + marker));
        _map.SetOnMapClickListener(point =>
        {
            Debug.Log("Map clicked: " + point);
            _map.AddMarker(DemoUtils.RandomColorMarkerOptions(point));
        });
        _map.SetOnLongMapClickListener(point =>
        {
            Debug.Log("Map long clicked: " + point);
            _map.AddCircle(DemoUtils.RandomColorCircleOptions(point));
        });

        // When the map is ready we can start drawing on it
        AddCircle();
        AddMarker();
        AddGroundOverlay();
        AddPolyline();
        AddPolygon();
        AddHeatmap();
        AddMarkerCluster();

        AddOtherExampleOverlays();
    }
Exemple #2
0
 void OnMapReady()
 {
     _map.AddMarker(new MarkerOptions().Position(new LatLng(-15.804948f, -47.949997f)).Title("SICOOB").Snippet("QUADRA SIA QUADRA 4-C, 36, LOJA 36 TÉRREO, Zona Industrial (Guará), Brasília - 71200-045"));
     _map.AddMarker(new MarkerOptions().Position(new LatLng(-15.798548f, -47.880858f)).Title("SICOOB COOPERPLAN").Snippet("SBS QD 01 BL J ED BNDES/IPEA SL.108, 1, SOBRELOJA, ASA SUL, Brasília - 70076-900"));
     _map.AddMarker(new MarkerOptions().Position(new LatLng(-15.7964211f, -47.8898464f)).Title("SICOOB CREDFAZ").Snippet("QD SCS QUADRA 5 BLOCO C LOTES 165 E 169, 165, Asa Sul, Brasília - 70305-921"));
     _map.AddMarker(new MarkerOptions().Position(new LatLng(-15.739804f, -47.893267f)).Title("SICOOB CREDIEMBRAPA").Snippet("CLN 116 Bl H, , LOJAS 59 E 65, Asa Norte, Brasília - 70773-580"));
     _map.AddMarker(new MarkerOptions().Position(new LatLng(-15.797050f, -47.886547f)).Title("SICOOB CREDIJUSTRA").Snippet("QD SCS QUADRA 2 BLOCO D, 3, SL 402 A 405 ED.OSCA, ASA SUL, Brasília - 70316-900"));
     _map.AddMarker(new MarkerOptions().Position(new LatLng(-15.7823f, -47.8873f)).Title("SICOOB CREDSEF").Snippet("SRTVN QUADRA 702 CONJ P SOBRELOJA, 50, ED. RADIO CENTER, ASA NORTE, BRASÍLIA - 70719-900"));
     _map.AddMarker(new MarkerOptions().Position(new LatLng(-15.802900f, -47.963502f)).Title("SICOOB EMPRESARIAL").Snippet("TRC SIA Trecho 3, 225, TÉRREO ED FIBRA, Zona Industrial (Guará), Brasília - 71200-030"));
     _map.AddMarker(new MarkerOptions().Position(new LatLng(-15.787927f, -47.878745f)).Title("SICOOB EXECUTIVO").Snippet("SBN QD 2 BL J ED ENGENHEIRO, , LOJAS 2,3,4 E MEZANI, ASA NORTE, Brasília - 70040-905"));
     _map.AddMarker(new MarkerOptions().Position(new LatLng(-15.80854f, -47.86614f)).Title("SICOOB JUDICIÁRIO").Snippet("ESPLANADA SAF SUL QD-06 LOTE 01 SALA 07, S/N, ED PLENÁRIOS - STJ, ASA SUL, Brasília - 70070-600"));
     _map.AddMarker(new MarkerOptions().Position(new LatLng(-15.8025f, -47.8629f)).Title("SICOOB LEGISLATIVO").Snippet("SAF SUL QUADRA 04 LOTE 1 2º SUBSOLO, S/N, ED. ANEXO III TCU, ASA SUL, Brasília - 70042-900"));
     _map.IsVisible = false;
 }
Exemple #3
0
    private void AddMarkers()
    {
        var paramList = TextDecoder.CreateCustomMarkerParamsList(markerData.text);

        foreach (var sth in paramList)
        {
            var options = new MarkerOptions()
                          .Position(sth.getLatLng())
                          .Title(sth.getTitle())
                          .Icon(NewCustomDescriptor())
                          .Snippet(sth.getSnippet());
            var marker = map.AddMarker(options);
        }
    }