title: Custom Leaflet Renderer for GeoJSON
body: <p>I want to render GeoJSON differently than provided by Leaflet by default. Unfortunately changing the <code>style()</code> function will not suffice as I need greater control over the vector graphics being created.</p>
  
  <p>What is the idiomatic way of doing this? I reckon I can reuse lots of parts of the default SVG renderer found in <code>src/layers/vector/SVG.js</code>. I would however like to only replace it for one GeoJSON layer / one FeatureGroup. As none of these inherit from <code>Path</code>, this does not seem possible.</p>
  
  <p>I tried extending the SVG class in a very basic way:</p>
  
  <pre><code>import {SVG} from 'leaflet/src/layer/vector/SVG'
  
  export default class CustomSVG extends SVG {
    _updatePoly (layer, closed) {
      console.log('Custom renderer in action')
      super._updatePoly(layer, closed)
    }
  }
  </code></pre>
  
  <p>and then set it as the renderer while initializing Leaflet, but this fails with a <code>TypeError: max2 is undefined</code> (it is an unhandled promise rejection which stems from me using <code>react-leaflet</code>).</p>
  
  <p>What is it I'm missing?</p>