New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-fmap

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-fmap

fengmap for react

latest
Source
npmnpm
Version
0.5.0
Version published
Maintainers
1
Created
Source

react-fmap

fengmap for react

npm NPM downloads

Using

  • install

npm i react-fmap

  • using in react
import FMap from 'react-fmap';
class App extends Component {
 render() {
 	const mapProps = {
 		fmapID: 'wafer-beijing',
 			appName:'北京威发新世纪',
 			mapKey:'3e7dba2418ac46e1af5a1abf17082db2',
 			height: 'calc(100vh - 254px)'
 		};

 		return (
 			<div className="App">
 				<FMap {...mapProps}/>
 			</div>
 		);
 	}
}

notice: mapKey is key of FengMap.

Props

Propdefault valueis requireddescription
urldome urlfalsefengmap.min.js
fmapIDtruefeng map id
appNamefalseapplication name
mapKeytruefeng map key
onClickfalsea callback for click map
classNamefalsemap mount dom's class name
widthfalsemap mount dom's width
heightfalsemap mount dom's height
defaultViewModetopfalse3d or 2d, value of ['3d', 'top']
mapOptionsfalsenew FMMap's other props
textMarkers[]falsetext marker eg: {x, y, name[, z, ...]}
imageMarkers[]falseimage marker eg: {x, y, url[, z, ...]}
toolControlnullfalsemap control tool. eg: 2d or 3d tool
controlOptionsnullfalsemap control options, eg: position or offset
offLineOptionsobjectfalseoff line map props
popMarkersnullfalsepop marker. props is controlOptions.
initialPositionnullfalseinitial move to position.
loadCompletenullfalsemap load complete function.
drawNaviLinesnullfalse[{lineStyle, startPoint, endPoint}]
rotate0falseset map rotate angle
mapServerURLfalseset map server url
mapThemeURLfalseset map theme url
defaultThemeNamefalseset map theme name

offLineOptions

	offLineOptions: {
		mapServerURL: '',
		mapThemeURL: '',
		defaultThemeName: ''
		[,
		...other props
		]
	}

function

namepropsreturndescription
setViewModemode: string ['top', '3d']this.mapreturn fengmap object
setThemethemeName: stringvoidset map theme name
setPopMarkeroptions: {}popMarkerpop mark on map. call popMarker.close() close pop marker
getSearchReq(request, callback)Array: FMapsearch map. request is object.eg: {ID: ''}
onNavigationoptions: {}FMapget navigation object
onMapFunctionname[, options]nullapply map function

add text marker

	this.map.getSearchReq({ID: 61}, v => {
		this.map.addTextMarker([{
		x: 12958819.3,
		y: 4852556.59,
		z: 0,
		name: '3F04'
		}], v.groupID);
	});

add image marker

 this.map.addImageMarker([{
		x:  12958819.3,
		y: 4852556.59,
		z: 0,
		name: '3F01',
		url: '/static/media/logo.5d5d9eef.svg'
	}], v.groupID);

onMapFunction

	this.map.onMapFunction('moveTo', {x: 12958819.3, y: 4852556.59, groupID: 1, z: 0});

fengmap.min.js

if localize fengmap.min.js, then copy `node_modules/react-fmap/js/fengmap.min.js` to src(or can reach at a dir).

then set `url`.

Keywords

react

FAQs

Package last updated on 02 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts