npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-fmap

v0.5.0

Published

fengmap for react

Downloads

8

Readme

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

| Prop | default value | is required | description | |------|-----|-----|----------------------------------| |url| dome url | false | fengmap.min.js | |fmapID| | true | feng map id | |appName| | false| application name | |mapKey| | true | feng map key | |onClick| | false | a callback for click map | |className| | false | map mount dom's class name | |width| | false | map mount dom's width | |height| | false | map mount dom's height | |defaultViewMode|top|false| 3d or 2d, value of ['3d', 'top']| |mapOptions| | false | new FMMap's other props | |textMarkers|[]| false | text marker eg: {x, y, name[, z, ...]}| |imageMarkers|[]| false | image marker eg: {x, y, url[, z, ...]}| |toolControl|null| false | map control tool. eg: 2d or 3d tool | |controlOptions|null| false | map control options, eg: position or offset | |offLineOptions| object | false | off line map props | |popMarkers| null | false | pop marker. props is controlOptions. | |initialPosition| null | false | initial move to position. | |loadComplete| null | false | map load complete function. | |drawNaviLines| null | false | [{lineStyle, startPoint, endPoint}] | |rotate| 0 | false | set map rotate angle | |mapServerURL| | false | set map server url | |mapThemeURL| | false | set map theme url | |defaultThemeName| | false | set map theme name |

offLineOptions

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

function

| name | props | return | description | |------|-----|-----|----------------------------------| | setViewMode | mode: string ['top', '3d'] | this.map | return fengmap object | |setTheme|themeName: string| void | set map theme name | |setPopMarker|options: {}| popMarker | pop mark on map. call popMarker.close() close pop marker | |getSearchReq|(request, callback)| Array: FMap | search map. request is object.eg: {ID: ''} | |onNavigation|options: {}| FMap | get navigation object | |onMapFunction|name[, options]| null | apply 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`.