title: Leaflet - How do I style a different geoJson feature based on common attributes?
body: <p>I'm trying to style a polyline layer when a point layer is clicked in Leaflet.
  Both layers are currently geoJson format so I access their properties through 'feature.properties'. </p>
  
  <p>I can get the 'Name' property for a selected point feature and I can separately highlight a polyline feature on a mouse event but I don't know how to call a function to highlight a polyline feature with the same attribute. </p>
  
  <p>Here's my code to add a point layer and get the name attribute: </p>
  
  <pre><code>//Add geoJson point layer
  var points = L.geoJson(geoJsonPoints, {
      pointToLayer: function (feature, latlng) {
          var iconType = 'images/'+feature.properties.Type+'.png';
          var marker = L.marker(latlng,{
                          icon: L.icon({iconUrl: iconType})
              });     
  
          marker.on("click", function (e) {
              var ptID = feature.properties.Name;
            //Call function to highlight line feature
              highlightFeature(ptID);
              });
  
          return marker;
          },
  
      onEachFeature: onEachPointFeature}
      );
  </code></pre>
  
  <p>And here's my code for styling polylines:</p>
  
  <pre><code>//Create polyline highlight style
  var highlightStyle = { 
          "color": "#2262CC",
          "weight": 7,
          "opacity": 1
      };
  
  //Highlight polyline features on event
  function highlightFeature(e) {
          var layer = e.target;
          // Change the style to the highlighted version
          layer.setStyle(highlightStyle);
  
          if (!L.Browser.ie &amp;&amp; !L.Browser.opera) {
              layer.bringToFront();
          }       
      };
  
  //Reset polyline style
  function resetHighlight(e){
          var layer = e.target;
          layer.setStyle(defaultStyle); 
      };
  </code></pre>