英文:
How to show name and location on the fragment map in MapsActivity?
问题
我正在尝试检索特定城市中商标地点的位置。我想显示地点名称和纬度经度。我该如何做到这一点?
public class Location {
private String name;
private double longitude;
private double latitude;
public Location(String name, double latitude, double longitude) {
this.name = name;
this.latitude = latitude;
this.longitude = longitude;
}
public String toString() {
return name + " (" + latitude + ", " + longitude + ")";
}
public String getName() {
return name;
}
public double getLongitude() {
return longitude;
}
public double getLatitude() {
return latitude;
}
}
英文:
I'm trying to retrieve the location of trademark places in specific cities. I want to display the place name and LatLng. How do I do that?
private String name;
private double longitude;
private double latitude;
public Location(String name, double latitude, double longitude) {
this.name = name;
this.latitude = latitude;
this.longitude = longitude;
}
public String toString() {
return name + " (" + latitude + ", " + longitude + ")";
}
public String getName() {
return name;
}
public double getLongitude() {
return longitude;
}
public double getLatitude() {
return latitude;
}```
</details>
专注分享java语言的经验与见解,让所有开发者获益!
评论