Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wemap/expo-livemap

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wemap/expo-livemap

Expose a Livemap component and methods to interact with it

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

@wemap/expo-livemap

A custom WebView component for Expo applications that exposes a Livemap component and methods to interact with it.

Installation

npm install @wemap/expo-livemap

Usage

Basic Usage

import React from 'react';
import { View } from 'react-native';
import { LivemapWebview } from '@wemap/expo-livemap';

function App() {
  return (
    <View style={{ flex: 1 }}>
        <LivemapWebview
        emmid={25414} />
    </View>
  );
}

Advanced Usage with Ref and event

import React, { useRef } from 'react';
import { View, Button } from 'react-native';
import { LiveMap, LiveMapRef } from '@wemap/expo-livemap';

function App() {
  const mapRef = useRef(null);

  const centerTo = () => {
    livemapWebviewRef.current?.centerTo({ latitude: 43.856614, longitude: 2.352222 }, 15);
  };

  const getUserLocation = () => {
    livemapWebviewRef.current?.getUserLocation().then((userLocation) => {
      console.log(userLocation)
    });
  };

  const onContentUpdated = (data) => {
    console.log('onContentUpdated', data.items.length);
  };

  return (
    <View style={{ flex: 1 }}>
        <LivemapWebview
        onContentUpdated={onContentUpdated}
        ref={livemapWebviewRef}
        emmid={25414} />
    </View>
  );
}

API Reference

Props

The component accepts all standard React Native WebView props plus specific livemap event like:

onContentUpdated(data) => void

All events are specified in the TypeScript definitions file

Ref Methods

The ref component can be used to trigger specific map action like centerTo or getUserLocation.

All ref methods are specified in the TypeScript definitions file

TypeScript Support

The package includes TypeScript definitions. For TypeScript projects, you can import types:

import { LivemapWebviewProps, LivemapWebviewRef } from '@wemap/expo-livemap';

Requirements

  • Expo SDK 51 or higher
  • React Native WebView 11 or higher

License

MIT

Author

Wemap

Keywords

FAQs

Package last updated on 13 Nov 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc