How to use geobuf in vue
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!