예제 #1
0
    private void OnPinClick(GameObject go)
    {
        OnlineMapsControlBase3D control2 = GetComponent <OnlineMapsControlBase3D> ();

        if (m_bPin1Set)
        {
            if (m_Pin1.instance == go)
            {
                m_bPin1Set = false;
            }
        }
        if (m_bPin2Set)
        {
            if (m_Pin2.instance == go)
            {
                m_bPin2Set = false;
            }
        }

        api.RemoveAllMarkers();
        api.RemoveAllDrawingElements();
        if (control2 != null)
        {
            control2.RemoveAllMarker3D();
        }

        if (m_bPin1Set)
        {
            OnlineMapsMarker3D marker = control2.AddMarker3D(m_Pin1Position.x, m_Pin1Position.y, m_PinPlane); //m_PinPlaneRed);
            //OnlineMapsMarker3D marker = control2.AddMarker3D (m_Pin1Position, m_PinPlane);
            marker.scale = 18.0f;                                                                             //30.0f;//18.0f;
            m_Pin1       = marker;
        }
        if (m_bPin2Set)
        {
            OnlineMapsMarker3D marker = control2.AddMarker3D(m_Pin2Position.x, m_Pin2Position.y, m_PinPlane); //m_PinPlaneRed);
            //OnlineMapsMarker3D marker = control2.AddMarker3D (m_Pin2Position, m_PinPlane);
            marker.scale = 18.0f;                                                                             //30.0f;//18.0f;
            m_Pin2       = marker;
        }
        addLineToPin();

        if (m_bPin1Set == false && m_bPin2Set == false)
        {
            m_ButtonReset.SetActive(false);
        }
        if (m_bPin1Set && m_bPin2Set)
        {
            m_ButtonNext.SetActive(true);
        }
        else
        {
            m_ButtonNext.SetActive(false);
        }
    }
예제 #2
0
    public void SetMarkers(Marker[] markers)
    {
        onlineMap.RemoveAllMarkers();
        if (markers != null)
        {
            for (int i = 0; i < markers.Length; i++)
            {
                OnlineMapsMarker mark = new OnlineMapsMarker();
                mark.position = markers[i].geoPos;
                //mark.label = markers[i].label;
                mark.OnClick    = OnClickMark;
                mark.customData = markers[i];
                mark.texture    = markTexture;
                onlineMap.AddMarker(mark);
            }
        }

        if (GeoLocation.posicaoEncontrada)
        {
            OnlineMapsMarker me = new OnlineMapsMarker();
            me.position = GeoLocation.position;
            me.texture  = myPositionTexture;
            onlineMap.AddMarker(me);

            onlineMap.Redraw();
        }
    }