question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[question] Center map at pre-defined coordinates via @click="function"

See original GitHub issue

Hello,

I’m trying to center the map on the coordinates and zoom I set, but I’m not getting it.

Maybe with $refs?

:zoom.sync="zoom"
:center.sync="center"
ref="view"

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
become-ironcommented, Jul 3, 2020
<template>
  <vl-view :zoom.sync="zoom" center.sync="center" />
</template>

<script>
  const center = [0, 0]
  const zoom = 1

  export default {
    data() {
      return {
        center: center,
        zoom: zoom
      }
    },

    methods: {
      zoomToInitialCoordinate() {
        this.center = center
        this.zoom = zoom
      }
    }
  }
</script>
0reactions
empereiracommented, Jul 3, 2020

Thanks @become-iron!!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Simulate click to map on specific coordinates and layer in ...
So, I search to simulate the 'click' event on a specific coordinates to simulate map click event and display my popup.
Read more >
Getting Lat/Lng from a Click Event | Maps JavaScript API
This example listens for the click event, gets the latitude and longitude coordinates of the click from google.maps.MapMouseEvent.
Read more >
Google Maps V3 -> Is it possible to trigger the on click event ...
javascript - Google Maps V3 -> Is it possible to trigger the on click event on a specific coordinate (lat, lng) programmatically -...
Read more >
Geopoints—ArcGIS Survey123 | Documentation
Geopoint questions allow you to capture a specific location in a survey. ... When capturing responses using a map, not all features of...
Read more >
Find elevations with the Tilequery API | Help - Mapbox docs
The Tilequery API allows you to retrieve data about specific features from a ... To get these coordinates, you will create a map.on('click')...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found