如何在MapsActivity的片段地图上显示名称和位置?

huangapple 未分类评论48阅读模式
英文:

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>


huangapple
  • 本文由 发表于 2020年5月5日 13:06:12
  • 转载请务必保留本文链接:https://java.coder-hub.com/61606122.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定