title: Style both points and multipolygons simultaneously Leaflet
body: <p>I was working on an application in which you can show <code>points</code> on a map. To improve the application, I added the functionality the show <code>multipolygons</code> as well. </p>
  
  <p>I've created a dropdowmenu where you can select a dataset. One is a dataset containing stores (points), and the other contains precincts (multipolygons). Everything works fine and I can show either points or polygons on the map.</p>
  
  <p>Because I build the application to only show points first, I've only styled the points (see code below).</p>
  
  <pre><code>var myStyle = {
  "color": "#ff7800",
  "weight": 5,
  "opacity": 0.65
  };
  
       window["mapDataLayer"] = L.geoJson(geojson, {
          pointToLayer: function (feature, latlng) {
              var markerStyle = { 
                  fillColor: getColor(feature.properties.Fastfoodketen),
                  color: "#696969",
                  fillOpacity: 0.6,
                  opacity: 0.9,
                  weight: 1,
                  radius: 8
              };
              return L.circleMarker(latlng, markerStyle);
          },
           onEachFeature: function (feature, layer){
             layer.on({
                  click: function showResultsInDiv() {
                      var d = document.getElementById('tab4');
                      d.innerHTML = "";
                          for (prop in feature.properties){
                          d.innerHTML += prop+": "+feature.properties[prop]+"&lt;br&gt;";
                          }
                      $('.nav-tabs a[href="#tab4"]').tab('show');
                  }
              }); },
           style: myStyle
      }).addTo(map);
  </code></pre>
  
  <p>Now I want to style the polygons. <strong>How can I alter the code above to include polygons as well?</strong></p>
  
  <p>I thought it would be a good way was to include an if/else loop to check if the geometry was a point or a multipolygon and then direct to the appropriate styling. However, I don't know how to check if a geometry is a point/polygon.</p>