How to use the react-leaflet.GeoJSON 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 LiveBy / react-leaflet-choropleth / choropleth.js View on Github external
features.map(function (feature, idx) {
          return _react2.default.createElement(_reactLeaflet.GeoJSON, _extends({
            key: identity ? identity(feature) : idx
          }, options, {
            style: _this3.getStyle(chroms, feature)
          }, _this3.getStyle(chroms, feature), {
            data: feature,
            children: _this3.props.children ? _this3.cloneChildrenWithFeature(_this3.props, feature) : _this3.props.children
          }));
        })
      );
github dymajo / waka / js / views / vehicle_loc.jsx View on Github external
import BusIcon from '../../dist/icons/bus.svg'

const iconMap = {
  train: ,
  ferry: ,
  bus: ,
}

import RotatedMarker from './rotated-marker.jsx'
let leaflet = require('react-leaflet')
let Map = leaflet.Map
let Marker = leaflet.Marker
let Popup = leaflet.Popup
let TileLayer = leaflet.TileLayer
let ZoomControl = leaflet.ZoomControl
let GeoJson = leaflet.GeoJSON
let Icon = require('leaflet').icon
let Circle = leaflet.Circle
let CircleMarker = leaflet.CircleMarker
let CurrentStop = window.location.pathname.slice(3, 7)
let geoID = undefined
let liveRefresh = undefined

const hiddenIcon = Icon({
  iconUrl: '/icons/normal/bus-fill.svg',
  iconSize: [48, 48],
  className: 'hiddenIcon',
})
const busIcon = Icon({
  iconUrl: '/icons/normal/bus-fill.svg',
  iconSize: [24, 24],
  className: 'vehIcon',
github dymajo / waka / js / views / line.jsx View on Github external
import React from 'react'
import { Link, browserHistory } from 'react-router'
import { StationStore } from '../stores/stationStore.js'
import { UiStore } from '../stores/uiStore.js'

let leaflet = require('react-leaflet')
let wkx = require('wkx')
let Buffer = require('buffer').Buffer
let Map = leaflet.Map
let Marker = leaflet.Marker
let Popup = leaflet.Popup
let TileLayer = leaflet.TileLayer
let ZoomControl = leaflet.ZoomControl
let GeoJson = leaflet.GeoJSON
let Icon = require('leaflet').icon
let Circle = leaflet.Circle
let CircleMarker = leaflet.CircleMarker

class Line extends React.Component {
  constructor(props) {
    super(props)
    this.state = {
      line: undefined,
      route_id: undefined,
      route_list: []
    }
    this.getWKB = this.getWKB.bind(this)
    this.getShapeIDs = this.getShapeIDs.bind(this)
    this.triggerTap = this.triggerTap.bind(this)
    this.convert = this.convert.bind(this)
github opentripplanner / otp-react-redux / build / components / map / itinerary-legs.js View on Github external
return _react.default.createElement(_reactLeaflet.FeatureGroup, null, itinerary.legs.map(function (leg, index) {
        var geojson = _polyline.default.toGeoJSON(leg.legGeometry.points);

        geojson.index = index;
        var active = activeLeg === index;
        var color = active ? 'yellow' : (0, _itinerary.isTransit)(leg.mode) ? 'blue' : 'black';
        return _react.default.createElement(_reactLeaflet.GeoJSON, {
          key: Math.random(),
          color: color,
          onClick: _this2._onLegClick,
          data: geojson
        });
      }));
    }
github hackoregon / civic / packages / component-library / lib / Maps / LeafletMap.js View on Github external
e.target.openPopup();
      });
    }
  }

  return _react2.default.createElement(
    'div',
    { className: 'mainMap' },
    _react2.default.createElement(
      _reactLeaflet.Map,
      { className: className, center: position, zoom: zoom, zoomControl: false, dragging: false, scrollWheelZoom: false, doubleClickZoom: false },
      _react2.default.createElement(_reactLeaflet.TileLayer, {
        url: url,
        attribution: attribute
      }),
      _react2.default.createElement(_reactLeaflet.GeoJSON, {
        data: _neighborhoodGeoJson2.default,
        onEachFeature: onEachFeature
      })
    )
  );
};