mirror of
https://github.com/chillzhuang/blade-tool
synced 2024-11-17 07:59:29 +08:00
✨ 代码完善
This commit is contained in:
parent
6e7246a44d
commit
5ac9287015
@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package org.springblade.core.tool.geo;
|
package org.springblade.core.tool.geo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
@ -99,6 +101,7 @@ public enum GeoType {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@JsonValue
|
||||||
private final String type;
|
private final String type;
|
||||||
private final String desc;
|
private final String desc;
|
||||||
|
|
||||||
@ -129,4 +132,20 @@ public enum GeoType {
|
|||||||
*/
|
*/
|
||||||
public abstract GeoPoint toBD09(double lon, double lat);
|
public abstract GeoPoint toBD09(double lon, double lat);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取坐标系
|
||||||
|
*
|
||||||
|
* @param type type 坐标系类型
|
||||||
|
* @return GeoType
|
||||||
|
*/
|
||||||
|
@JsonCreator
|
||||||
|
public static GeoType getGeoType(String type) {
|
||||||
|
for (GeoType geoType : values()) {
|
||||||
|
if (geoType.type.equalsIgnoreCase(type)) {
|
||||||
|
return geoType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException("未知的坐标系类型" + type);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user