mapbox/mapbox-gl-js

validate property names in getPaintProperty

Ouverte

#6 033 ouverte le 22 janv. 2018

 (2 commentaires) (5 réactions) (0 personne assignée)JavaScript (2 203 forks)batch import
api :memo:good first issue

Métriques du dépôt

Stars
 (10 532 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

Description

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

Guide contributeur