繪製線條

$('#map-polyline-01').tinyMap({
    'center': ['25.039726809855434', '121.55633926391602'],
    'zoom': 14,
    'polyline': [
        {
            'coords': [
                ['25.034516521123315','121.56496524810791'],
                ['25.037627167884715', '121.56732559204102'],
                ['25.039726809855434', '121.55633926391602'],
                ['25.037160575899154', '121.55350685119629'],
                ['25.035877438787317', '121.55715465545654']
            ],
            'color': '#CC0000',
            'width': 4,
            'opacity': 0.6,
        }
    ]
});

利用路徑規劃繪製線條

$('#map-polyline-02').tinyMap({
    'center': ['25.039726809855434', '121.55633926391602'],
    'zoom': 14,
    'polyline': [
        {
            'coords': [
                ['25.034516521123315','121.56496524810791'],
                ['25.037627167884715', '121.56732559204102'],
                ['25.039726809855434', '121.55633926391602'],
                ['25.037160575899154', '121.55350685119629'],
                ['25.035877438787317', '121.55715465545654']
            ],
            'color': '#CC0000',
            'width': 4,
            'opacity': 0.6,
            'snap': true
        }
    ]
});

繪製圓形

$('#map-circle-01').tinyMap({
    'center': ['25.047924', '121.51708099999996'],
    'zoom': 14,
    'circle': [
        {
            'center': ['25.047924', '121.51708099999996'],
            'radius': 500,
            'width': 1,
            'color': '#333333',
            'fillcolor': '#999999'
        }
    ]
});

繪製多邊形

$('#map-polygon-01').tinyMap({
    'center': ['25.05425179688806', '121.52795111083981'],
    'zoom': 14,
    'polygon': [
        {
            'coords': [
                ['25.05922799282222', '121.52348791503903'],
                ['25.05580687982226', '121.52331625366207'],
                ['25.05425179688806', '121.52795111083981'],
                ['25.05751744826025', '121.53378759765621'],
                ['25.064048489938642', '121.52915274047848'],
                ['25.05922799282222', '121.52348791503903']
            ],
            'color': '#000033',
            'fillcolor': '#0000cc',
            'width': 1,
            'event': function (e) {
                alert('You clicked at: ' + e.latLng.lat() + ', ' + e.latLng.lng());
            }
        }
    ]
});

留言 Comments

comments powered by Disqus