Socket
Socket
Sign inDemoInstall

@vulcangz/svelte-baidumaps

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @vulcangz/svelte-baidumaps

Svelte components based on Baidu Map JavaScript Api package


Version published
Maintainers
1
Install size
312 kB
Created

Readme

Source

Svelte Baidu Maps components

Svelte components based on Baidu Map JavaScript Api package.

Demo

  • https://vulcangz.github.io/svelte-baidumaps/demo/
  • Demo with REPL support

Install

npm install --save @vulcangz/svelte-baidumaps

Usage

To use within a Svelte application:

1. First you need to request and obtain the map api key:

The key can be applied to the official website of Baidu map open platform

2. Basic Usage (Map)

The container component is the map, and there are a variety of components which go on the map.

<Map apiKey="your_api_key" options={ baseMapConfig } withCenterMarker={ true } >
  <Marker lat={someLat} lng={someLng} label="text label" /> // built in Marker component
  <NavigationControl />
  <ScaleControl />
</Map>

<script>
  import { Map, Marker, NavigationControl, ScaleControl } from '@vulcangz/svelte-baidumaps'

  let baseMapConfig = {
    label: "this is a map base demo",
    address: "china beijing",
    lng: "116.404",
    lat: "39.915",
    zoom: 15
  };
</script>
3. Basic Usage (MarkerList)

See PointCollection for more information on API.

<Map apiKey="your_api_key" options={ pointCollectionMapConfig }>
  <MarkerList markers={ data } />
  <NavigationControl />
  <ScalingControl />
</Map>

<script>
  import { Map, MarkerList, NavigationControl, GeolocationControl } from '@vulcangz/svelte-baidumaps'
  import { data } from './your-marker-points-data.js';

  let pointCollectionMapConfig = {
    label: "this is map point collection demo",
    address: "china beijing",
    lng: "105.000",
    lat: "38.000",
    zoom: 12
	}; 
</script>

Components

Core component

  • Map

Control components

  • NavigationControl
  • MapTypeControl
  • ScaleControl
  • CopyrightControl
  • OverviewMapControl
  • CityListControl

Overlay components

  • Marker
  • MarkerList
  • Circle
  • Icon
  • InfoWindow
  • Label
  • Polygon
  • Polyline

Service components

  • LocalSearch
  • Bus
  • Transit
  • Walking
  • Driving
  • LocalCity
  • Autocomplete

Todo

  • test
  • docs

Credits and Inspiration

Keywords

FAQs

Last updated on 20 Sep 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc