maptalks / maptalks/maptalks.mapboxgl
当使用MapboxglLayer读取mapbox的style作为地图时,在倾斜地图后,再旋转地图,已经绘制的线要素会发生无规律偏移
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 60
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
创建一个地图,style自行替换
var map = new maptalks.Map('map', {
center: [114, 31],
zoom: 10,
baseLayer: new maptalks.MapboxglLayer('tile', {
glOptions: {
'style': 'http://ip/styles/style.json'
}
})
});
var layer = new maptalks.VectorLayer('vector', {forceRenderOnMoving: true}).addTo(map);
再加入一段线,线务必多于三个点
var start = [114, 31],
middle1 = [114, 31.05],
middle2 = [114.05, 31.05],
end = [114.05, 31.08];
var coords = [start, middle1, middle2, end]
var arrow = new maptalks.LineString(
coords,
{
'id': 'arrow',
'arrowStyle': 'classic',
'arrowPlacement': 'vertex-last'
}
) .addTo(layer);
然后倾斜地图45度角或其他倾斜角度,再旋转地图即可见效果
引入的相关库如下:
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Use the supplied browser reproduction with MapboxglLayer, a four-point LineString, 45-degree pitch, and map rotation. Inspect the MapboxglLayer integration and vector rendering entry points; done means the already-drawn line remains aligned after pitching and rotating the map.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100