1.1.4 • Published 4 years ago

material-ui-gps-player v1.1.4

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago


This react component is fully developed using React Material UI framework to show GPS paths. You can play, pause and stop while playing GPS coordinates with this component.

material-ui-gps-player Preview

Installation

npm install @material-ui/core @material-ui/icons react react-dom material-ui-gps-player --save

Usage

import Player from 'material-ui-gps-player';


class App extends Component {


  render() {
    return (
      <div>
        <Player
          apiKey="Your Key"
          language="en"
          zoom={14}
          coordinates={data}
        />
      </div>
    );
  }
}

Props

Props (* required)DefualtDescriptionType
apiKey *undefinedAPI key for google mapsstring
coordinates*[]GPS Coordinates that containing lat:float,lng:float,time:int,bearing?:float properties. lat,lng,time properties are required. time property is expecting a UNIX timestamp and all other properties (lat,lng,bearing) expecting floats. bearing is optional. We are calculating bearing using nearest coordinates if you didn't supply. Pass boolean value to marker if you want to display a marker. All other properties taking as marker's props if marker is true.array
time:int is passing to all below callbacks as the first parameter.
onChangeTimeundefinedWhen time has changed in the player.function
onChangeSpeedundefinedWhen player speed is changed.function
onPlayundefinedThis function will trigger when play button is clicked.function
onPauseundefinedWhen click the pause iconfunction
onPauseundefinedWhen click the stop iconfunction
currentTimeundefinedCurrently playing time in UNIX formatnumber
speeds[-200, -100, 50, 100, 200, 500, 750, 1000]Available speeds for the player. Current speed is choosing from these values when click on the forward button.number[]
speedinternal statesCurrently playing speed. We are using our internal state if you didn't supplied a speed.number
timeFormatHH:mm:ssTime format to display start/end times. Please supply a time format supported in moment.string
iconMarker{scale: 6,fillColor: blue[600],fillOpacity: 1,strokeWeight: 0}google marker icon decorations.object
widthundefinedWidth for the player wrapper.number
height500Height of the player wrapper.number
center{lat: 7.8731,lng: 80.7718}This is the center of map when initializing. center parameter required a object that contains lat, lng properties.object
polyLineundefinedPoly Line properties. Ex:- {strokeWidth:4, strokeColor: '#fff'}object
speedMultiplier25Speed multiplier when switching between waiting time enabled and disabled.number

Testing

Install depedencies

npm install

Start the testing app

npm start

Contribution

All PR s and issues are welcome!

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago