How to use the react-leaflet.Polyline function in react-leaflet

To help you get started, we’ve selected a few react-leaflet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github opentripplanner / otp-react-redux / build / components / map / trip-viewer-overlay.js View on Github external
value: function render() {
      var tripData = this.props.tripData;
      if (!tripData || !tripData.geometry) return _react.default.createElement(_reactLeaflet.FeatureGroup, null);

      var pts = _polyline.default.decode(tripData.geometry.points);

      return _react.default.createElement(_reactLeaflet.FeatureGroup, null, _react.default.createElement(_reactLeaflet.Polyline, {
        positions: pts,
        weight: 8,
        color: "#00bfff",
        opacity: 0.6
      }));
    }
  }]);
github PaulLeCam / react-leaflet / example / build / app.js View on Github external
}),
        _react2['default'].createElement(_reactLeaflet.Circle, { center: center, fillColor: 'blue', radius: 200 }),
        _react2['default'].createElement(
          _reactLeaflet.CircleMarker,
          { center: [51.51, -0.12], color: 'red', radius: 20 },
          _react2['default'].createElement(
            _reactLeaflet.Popup,
            null,
            _react2['default'].createElement(
              'span',
              null,
              'Popup in CircleMarker'
            )
          )
        ),
        _react2['default'].createElement(_reactLeaflet.Polyline, { color: 'lime', positions: polyline }),
        _react2['default'].createElement(_reactLeaflet.MultiPolyline, { color: 'lime', polylines: multiPolyline }),
        _react2['default'].createElement(_reactLeaflet.Polygon, { color: 'purple', positions: polygon }),
        _react2['default'].createElement(_reactLeaflet.MultiPolygon, { color: 'purple', polygons: multiPolygon }),
        _react2['default'].createElement(_reactLeaflet.Rectangle, { bounds: rectangle, color: 'black' })
      );
    }
  }]);
github opentripplanner / otp-react-redux / build / components / map / route-viewer-overlay.js View on Github external
Object.values(routeData.patterns).forEach(function (pattern) {
        if (!pattern.geometry) return;

        var pts = _polyline.default.decode(pattern.geometry.points);

        segments.push(_react.default.createElement(_reactLeaflet.Polyline, {
          positions: pts,
          weight: 4,
          color: routeColor,
          opacity: 1,
          key: pattern.id
        }));
      });
      return segments.length > 0 ? _react.default.createElement(_reactLeaflet.FeatureGroup, null, _react.default.createElement("div", null, segments)) : _react.default.createElement(_reactLeaflet.FeatureGroup, null);