mapbox/mapbox-gl-js

validate property names in getPaintProperty

Open

#6,033 创建于 2018年1月22日

在 GitHub 查看
 (2 评论) (5 反应) (0 负责人)JavaScript (10,532 star) (2,203 fork)batch import
api :memo:good first issue

描述

map.setPaintProperty(layer, key value) validates arguments but map.getPaintProperty does not. Providing a bad property key will trigger an internal error. It should trigger an error with a helpful errror message. Seen here: https://github.com/mapbox/mapbox-gl-js/issues/6030

mapbox-gl-js version: v0.43.0 and master

Steps to Trigger Behavior

  1. map.getPaintProperty("background", "fill-radius");

Expected Behavior

something like: "fill-radius" is not a paint property background layers"

Actual Behavior

Uncaught TypeError: Cannot read property 'value' of undefined

贡献者指南