Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use geobuf in vue

Shulou Source: shulou.com Published: 2022-06-01 00:22:40 09月21日 Update

This article introduces the knowledge of "how to use geobuf in vue". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Geobuf and pbf libraries need to be installed

Cnpm I-S geobuf pbf

Introduce

Import geobuf from 'geobuf';import Pbf from' pbf'

Use:

Let geojson_multiPolygon = {type: 'Feature', properties: {}, geometry: {type:' MultiPolygon', coordinates: [109.2041015625, 30.088107753367257], [115.026855468730.08810753367257], [115.026855468732.7872745269555], [109.2041015625, 32.7872745269555] [109.2041015625, 30.088107753367257], [112.9833984375, 26.82407078047018], [116.69677734375, 26.82407078047018], [116.69677734375, 29.036960648558267], [112.9833984375, 29.036960648558267], [112.9833984375 26.82407078047018]}} Let a = geobuf.encode (geojson_multiPolygon, new Pbf ()); console.log ('serialization:', a); let b = geobuf.decode (new Pbf (a)); console.log ('deserialization:', b)

This is the end of the content of "how to use geobuf in vue". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Content sequence more knowledge practical successful next two dilemma reality situation article case editing website industry process high quality learning related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Docker Apple Xiaomi Microsoft