1

Highmap メタデータにはオプション 'hc-transform' がありますが、その使用方法を説明できますか?

ハイマップでデフォルトの中国地図地理データを使用しましたが、[緯度、経度] [121,23] などの新しいポイントを追加したいのですが、それを座標に変換する方法を知りたいです。

"crs": {
    "type": "name",
    "properties": {
        "name": "urn:ogc:def:crs:EPSG:3415"
    }
},     
"hc-transform": {
    "cn-all": {
        "xpan": 350,
        "ypan": 25,
        "hitZone": {
            "type": "Polygon",
            "coordinates": [
                [
                    [7902,3046],
                    [7929,3041],
                    [7947,3014],
                    [7915,2972]
                ]
            ]
        },
        "crs": "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +toWGS84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +vunits=m +no_defs",
        "scale": 0.000129831107685,
        "jsonres": 15.5,
        "jsonmarginX": -999,
        "jsonmarginY": 9851.0,
        "xoffset": -3139937.49309,
        "yoffset": 4358972.7486
    }
}

これが私がすることです。

var transform = Highcharts.maps['countries/cn/cn-all']['hc-transform']['default'];
var position = $(".chart").highcharts().transformFromLatLon({ lat: 121, lon: 23 }, transform);
console.log(position); // {x:NaN ,y:NaN}

「hc-transform」設定が間違っていますか? どのようにケースを作成すればよいですか。

4

1 に答える 1