leaflet入门(二)GeoJson

GeoJson格式数据的形式

Using GeoJSON with Leaflet

GeoJSON is becoming a very popular data format among many GIS technologies and services — it's simple, lightweight, straightforward, and Leaflet is quite good at handling it. In this example, you'll learn how to create and interact with map vectors created from GeoJSON objects.

译:通过Leaflet使用GeoJson。

GeoJSON是一种在GIS工程和服务中变的很流行的数据格式,简单,轻量级,明确,并且Leaflet能很好的处理它。在这个例子中,你会学会如何通过GeoJSON对象创建地图矢量并与之交互。

 

单个要素数据:

var geojsonFeature = {
"type": "Feature",          //要素类型
"properties": {                //属性
    "name": "Coors Field",
    "amenity": "Baseball Stadium",
    "popupContent": "This is where the Rockies play!"
},
"geometry": {                //要素地理坐标
    "type": "Point", //元素类型
    "coordinates": [-104.99404, 39.75621]  //坐标
}
};

要素集合的定义形式:

var geojsonFeature={
    "type": "FeatureCollection",        //要素集合
    "features": [
        {
            "type": "Feature",        //要素类型
            "id": "6328",
            "properties": {            //属性
                "flag":'100',
                "name": "海西蒙古族藏族自治州",
                "cp": [
                    94.9768,
                    37.1118
                ],
                "childNum": 7
            },
            "geometry": {            //要素地理坐标
                "type": "MultiPolygon",
                "coordinates": [
                    [
                    .........

 

转载于:https://www.cnblogs.com/tinaluo/p/7244277.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值