vue-mapbox | Vuejs 2 components for interacting with mapbox-gl-js | Frontend Framework library

 by   soal JavaScript Version: 0.4.1 License: MIT

kandi X-RAY | vue-mapbox Summary

kandi X-RAY | vue-mapbox Summary

vue-mapbox is a JavaScript library typically used in User Interface, Frontend Framework, Vue, Tailwind CSS applications. vue-mapbox has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can install using 'npm i vue-mapbox' or download it from GitHub, npm.

Vuejs 2 components for interacting with mapbox-gl-js
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              vue-mapbox has a low active ecosystem.
              It has 405 star(s) with 124 fork(s). There are 14 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 68 open issues and 64 have been closed. On average issues are closed in 38 days. There are 27 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of vue-mapbox is 0.4.1

            kandi-Quality Quality

              vue-mapbox has 0 bugs and 0 code smells.

            kandi-Security Security

              vue-mapbox has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              vue-mapbox code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              vue-mapbox is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              vue-mapbox releases are available to install and integrate.
              Deployable package is available in npm.
              Installation instructions are not available. Examples and code snippets are available.
              vue-mapbox saves you 1272 person hours of effort in developing the same functionality from scratch.
              It has 2859 lines of code, 0 functions and 78 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed vue-mapbox and discovered the below as its top functions. This is intended to give you an instant insight into vue-mapbox implemented functionality, and help decide if they suit your requirements.
            • Creates a function that will build the event data and dispatches it .
            • creates a function for event listeners
            • Applies properties to the target object .
            • Spread properties from source to target .
            • Swap properties to the target object .
            • Spread all properties to the target object .
            • Spread all properties of the target .
            • Spread properties from source object .
            • Applies properties to the target object .
            • Spread all properties of the source object .
            Get all kandi verified functions for this library.

            vue-mapbox Key Features

            No Key Features are available at this moment for vue-mapbox.

            vue-mapbox Examples and Code Snippets

            No Code Snippets are available at this moment for vue-mapbox.

            Community Discussions

            QUESTION

            Vue.js initialize custom component only once and use it as base for multiple views
            Asked 2022-Mar-21 at 12:49

            I created a vue component based on MapBox, which is restricted in initializations before it costs money and that is perfectly fine. But I want to reduce reinitializations of my map component for their and my sake. That's why I thought if it is possible to define the component once, pass in some properties and then handle the state via vuex.

            Right now, I'd have to import my component and add the data like this:

            ...

            ANSWER

            Answered 2022-Mar-21 at 12:49

            You can use <KeepAlive>, a built-in component available in both Vue2 (docs) and Vue3 (docs).

            Basically it ensures that a component tagged with keep-alive will only be mounted once. So in your case, you can place the map wherever you want, and the Map will only be initialized once in its mounted hook.

            If you need to utilize the moment that your Map gets "focused" or "activated" so to say, then you can utilize the activated and deactivated hooks.

            Why you cannot use KeepAlive.

            There is an obvious and logical limitation. As long as the parent is alive and mounted, the component's children that are being kept-alive will stay alive. But if the keep-alive component's parent gets unmounted, then all the children will be unmounted aswell even if they were being kept alive. This is all very obvious but I just felt like pointing it out.

            Solution

            So, in your use case, you want a component (the component) to be globally kept-alive after its first initialization. I suggest you cache the map element itself and store it in the store. Then on every component onBeforeMount (Composition API) or beforeMount (Options API) hook, manually check if the element is cached, if it is then insert the cached map from the store, otherwise initialize the map.

            Source https://stackoverflow.com/questions/71554507

            QUESTION

            MapBox: Legend not working when full screen
            Asked 2021-Apr-27 at 00:28

            I have a legend inside the map, is working fine when the map is not full screen, but when the map is full screen the legend is not showing.

            To Reproduce

            Steps to reproduce the behavior:

            1. Open the map and see the legend is present and working fine
            2. Click full screen icon
            3. The legend is not present
            4. Click full screen icon again to remove the full screen, now the legend is present and working fine

            Expected behavior

            The legend should work fine when full screen.

            Screenshots

            Normal screen, working fine:

            Full screen, not showing the legend:

            Additional context

            Code example available on codesandbox https://codesandbox.io/s/ecstatic-wave-c3qmg. You should open the link https://c3qmg.csb.app/ on another page to be able to see the fullscreen icon.

            Code extract:

            ...

            ANSWER

            Answered 2021-Apr-27 at 00:28

            By default, the Mapbox GL JS fullscreen control only makes the map container itself full screen. Nothing else on the screen will be visible.

            So you need to pass the container element through to Vue-Mapbox's MglFullScreenControl as the container parameter, along these lines:

            Source https://stackoverflow.com/questions/67226429

            QUESTION

            Map layers do not render again past initial load
            Asked 2021-Jan-21 at 09:59

            I am using VueMapbox (0.4.1) to utilize Mapbox GL in a Vue project.

            ...

            ANSWER

            Answered 2021-Jan-13 at 07:41

            Despite I don’t know the syntax of Vue.js, the problem you are facing is that you are creating your layers in map.on('load', ... which is an event that happens only once, so when the style change happens, all the layers of the map style (including the ones created by custom code) are removed.
            If you want to recreate your layers on style change, you have to do it in the event map.on('style.load', ..., but as said, I don’t see in your vue.js code where that is being done. If you share the part of the code where vue.js is invoking the methods it’ll be easier to help you

            Source https://stackoverflow.com/questions/65694554

            QUESTION

            Fix the upstream dependency conflict installing NPM packages
            Asked 2020-Nov-30 at 10:46

            Trying to npm install vue-mapbox mapbox-gl and I'm getting a dependency tree error.

            I'm running Nuxt SSR with Vuetify, and haven't installed anything related to Mapbox prior to running this install and getting this error.

            ...

            ANSWER

            Answered 2020-Nov-24 at 13:42

            Looks like it's a problem with Peer Dependencies in the latest version of npm (v7) which is still a beta version. try with npm install --legacy-peer-deps for detail info check this https://blog.npmjs.org/post/626173315965468672/npm-v7-series-beta-release-and-semver-major

            Source https://stackoverflow.com/questions/64936044

            QUESTION

            cannot set initial bounds of vuemapbox map
            Asked 2020-May-12 at 14:13

            I am using mapbox-gl and vue-mapbox [https://soal.github.io/vue-mapbox/api/#props]

            in my vuejs app to display a map. I would like to initialize the map with boundaries that encompass the continental US and when the map loads, I'd like to zoom in to a certain location in the US.

            If I include the "center" and "zoom" props in the element, I can get the map will initialize to the continental US. But then, map.fitBounds() doesn't work.

            If I don't include the center prop in the element, fitBounds() works, but mapbox uses the center of my style, which is Paris, France. I like crepes, but I don't like this.

            ...

            ANSWER

            Answered 2020-May-12 at 14:13

            Sorry I'm not the author of the vue-mapbox library, though I have made a small contribution to it.

            Yes you can change the center of a style in Mapbox Studio, here's how :

            The problem you mention is because center and zoom properties are synced. But changing the center of the style should work in your case.

            Source https://stackoverflow.com/questions/61649998

            QUESTION

            VueMapbox trying to create multiple markers
            Asked 2020-Apr-02 at 01:34

            I am trying to create multiple markers in Vue using VueMapbox. Currently the map displays correctly but there is only one marker. I think there is something wrong either with my v-for statement or perhaps in the forEach statement. I am trying to place a marker on each location but only the first location is added.

            Here is the code for my vue component:

            ...

            ANSWER

            Answered 2020-Apr-02 at 01:34

            You're currently doing a v-for on coordinates. It should be on locations.

            If locations don't have all the required props a MglMarker needs, transform them in the forEach but that's all you should do in that forEach (if you need it at all). Don't use it to populate this.country, this.cases or this.coordinates. You only want to set those when a marker is clicked (if, and only if, you have any functionality listening to changes on those Vue instance properties).

            There might be more details which need to be fixed but, without a minimal reproducible example it's very difficult to spot them. Note: you'll need to create a mapbox public token with readonly permissions for your example to work.

            To summarize: Move the functionality from your forEach into a function called showMarker or activateMarker. Call that function whenever a marker is clicked or, if that's what you want, call it on one of the locations to make it the currently active one.
            What your code does now is: it makes all markers the currently active one, therefore only the last one iterated will be currently active.

            Here's what your MglMarker iterator might look like:

            Source https://stackoverflow.com/questions/60982453

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install vue-mapbox

            You can install using 'npm i vue-mapbox' or download it from GitHub, npm.

            Support

            Documentation use VuePress 1.0. Documentations source palced in docs_source directory and builds into docs directory.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • npm

            npm i vue-mapbox

          • CLONE
          • HTTPS

            https://github.com/soal/vue-mapbox.git

          • CLI

            gh repo clone soal/vue-mapbox

          • sshUrl

            git@github.com:soal/vue-mapbox.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link