Code Monkey home page Code Monkey logo

vue2-leaflet-vectorgrid's Introduction

vue2-leaflet-vectorgrid

This is a VectorGrid plugin extension for the vue2-leaflet package. Currently only the VectorGrid.protobuf layer is implemented.

Install

npm install vue2-leaflet-vectorgrid

Quickstart

For a complete example, have a look at the demo code in the single-file component example.

On <template> add something like this

<l-map :zoom=10 :center="[-34.9205, -57.953646]">
  <l-protobuf url="https://example.com/my/favorite/endpoint/{z}/{y}/{x}.pbf" :options="options"/>
</l-map>

on <script> add

import { LMap } from 'vue2-leaflet';
import LProtobuf from 'vue2-leaflet-vectorgrid'

export default {
  components: {
    LMap,
    LProtobuf
  },
  data () {
    return {
      options: {
      	vectorTileLayerStyles: { ... },
         ...  // More VectorGrid options.
      }
    }
  }
}

Example

There is a simple but complete usage example. First, clone the repo and install its dependencies.

git clone [email protected]:tesselo/vue2-leaflet-vectorgrid.git
cd vue2-leaflet-vectorgrid
npm install

Also install peer dependencies.

npm install vue leaflet vue2-leaflet

To run the example @vue/cli and @vue/cli-service-global are required to be installed globally.

   npm install -g @vue/cli @vue/cli-service-global

Start the dev server using the the vue serve utility

vue serve example/app.vue

Then you should be able to navigate with your browser and see the demo at http://localhost:8080/.

Develop and build

npm install
npm run build

Deploy

Pack locally for install testing.

npm pack

Publish release

npm publish

Acknowledgements

Thanks to Aaron Gong and Julián Perelli, the authors of the markercluster plugin and the tracksymbol plugin. Both packages have been used as a basis to build this plugin.

vue2-leaflet-vectorgrid's People

Contributors

ashleysommer avatar bezany avatar goncalomarques avatar yellowcap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vue2-leaflet-vectorgrid's Issues

Does not show the layer

Hello how are you?

I'm trying to use the component to show my own layer served as VT.

If I do it with Leaflet andL.vectorGrid.protobuf as a test, it works fine, but when I take it to my application that uses Vue Leaflet and your component, it does not show me the points, I do not get errors or anything, but if I see the response of the requests, I am obtaining the data in the right way from the server

imagen

        <l-protobuf
          :options="vectorTileOptions"
          url="http://127.0.0.1:8009/tiles/{z}/{y}/{x}.pbf"
          name="Puntos VTL"
          layerType="overlay"
        />
      vectorTileOptions: {
        vectorTileLayerStyles: {
          puntos: {
            color: '#666666',
            weight: 2,
            fillColor: '#ffb407',
            opacity: 1,
            fillOpacity: 0.4,
            fill: true
          }
        },
        minZoom: 8,
        maxZoom: 18,
        interactive: true
      }

Any idea about this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.