Coder Social home page Coder Social logo

Comments (4)

eregnier avatar eregnier commented on June 19, 2024 1

solved in 5.5.4 version, npm is up to date with the fix.

from vue2-gmap-custom-marker.

eregnier avatar eregnier commented on June 19, 2024

It should work. You may take a look at the live demo https://eregnier.github.io/vue2-gmap-custom-marker/dist/ where there is a sample of z-index live edit component that dynamically toggle on user inputs.

Tell me if it is ok or not.

Regards

from vue2-gmap-custom-marker.

vlada-symphony avatar vlada-symphony commented on June 19, 2024

Hey, thanks for answering. Demo works as expected, but I think this happens only when custom marker is defined with v-for. I updated demo code with something like this:

<gmap-custom-marker
  v-for="marker in myMarkers"
  :key="marker.key"
  :z-index="marker.zIndex" :marker="marker.location"
  :style="{ backgroundColor: marker.background }"
>
  <div class="zindex">
    <center>
      <p>
        <b>{{marker.zIndex}}</b>
      </p>
      <button @click="marker.zIndex++">+</button>
      <button @click="marker.zIndex--">-</button>
    </center>
  </div>
</gmap-custom-marker>

and myMarkers is defined like this:

data() {
  return {
    myMarkers: [
      {
        location: { lat: 50.4272265, lng: 2.95 },
        key: 0,
        background: "#bbdddd",
        zIndex: 50,
      },
      {
        location: { lat: 50.4272265, lng: 2.80 },
        key: 1,
        background: "#ddbbdd",
        zIndex: 51,
      },
    ],
  },
}

And then the bug reproduced. <b>{{marker.zIndex}}</b> updates its text correctly, but z-index isn't updated until the map is moved or zoomed in/out (which is why I assumed repaint method isn't called or something).

from vue2-gmap-custom-marker.

eregnier avatar eregnier commented on June 19, 2024

Thank you @vlada-symphony for help in this plugin improvement.

from vue2-gmap-custom-marker.

Related Issues (20)

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.