Exemplo n.º 1
0
    void OnGUI()
    {
        GUILayout.Label("Absolute longitude/latitude to meters", EditorStyles.boldLabel);
        ShowLonLatFields(ref all2mX, ref all2mY);
        ShowResultMeters(GeoCalculator.LonLatToMeters(all2mX, all2mY));

        EditorGUILayout.Space();

        GUILayout.Label("Absolute meters to longitude/latitude", EditorStyles.boldLabel);
        m2llX = EditorGUILayout.FloatField("Meters X", m2llX);
        m2llY = EditorGUILayout.FloatField("Meters Y", m2llY);
        ShowResultLonLat(GeoCalculator.MetersToLonLat(m2llX, m2llX));

        EditorGUILayout.Space();

        GUILayout.Label("Absolute pixels to meters", EditorStyles.boldLabel);
        ShowPixelFields(ref ap2mX, ref ap2mY, ref ap2mZ);
        ShowResultMeters(GeoCalculator.AbsolutePixelsToMeters(ap2mX, ap2mY, ap2mZ));

        EditorGUILayout.Space();

        GUILayout.Label("Relative pixels to meters", EditorStyles.boldLabel);
        ShowPixelFields(ref rp2mX, ref rp2mY, ref rp2mZ);
        ShowResultMeters(GeoCalculator.RelativePixelsToMeters(rp2mX, rp2mY, rp2mZ));

        EditorGUILayout.Space();

        GUILayout.Label("Absolute meters to pixels", EditorStyles.boldLabel);
        ShowMeterFields(ref am2pX, ref am2pY, ref am2pZ);
        ShowResultPixels(GeoCalculator.AbsoluteMetersToPixels(am2pX, am2pY, am2pZ));

        EditorGUILayout.Space();

        GUILayout.Label("Relative meters to pixels", EditorStyles.boldLabel);
        ShowMeterFields(ref rm2pX, ref rm2pY, ref rm2pZ);
        ShowResultPixels(GeoCalculator.RelativeMetersToPixels(rm2pX, rm2pY, rm2pZ));

        EditorGUILayout.Space();

        GUILayout.Label("Absolute longitude/latitude to tile", EditorStyles.boldLabel);
        ShowLonLatFields(ref all2tX, ref all2tY, ref all2tZ);
        ShowResultTile(GeoCalculator.AbsoluteCoordinateToTile(all2tX, all2tY, all2tZ));

        EditorGUILayout.Space();

        GUILayout.Label("Absolute tile to longitude/latitude", EditorStyles.boldLabel);
        ShowTileFields(ref at2llX, ref at2llY, ref at2llZ);
        ShowResultLonLat(GeoCalculator.AbsoluteTileToCoordinate(at2llX, at2llY, at2llZ));
    }