# \[Kibana/Vega\] Map signals latitude, longitude & zoom

**URL:** https://discuss.elastic.co/t/kibana-vega-map-signals-latitude-longitude-zoom/267796
**Category:** Kibana
**Tags:** vega
**Created:** [March 19, 2021, 10:25am UTC](https://discuss.elastic.co/t/kibana-vega-map-signals-latitude-longitude-zoom/267796 "2021-03-19T10:25:12Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Kayak007](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kayak007/32/147597_2.png) [@Kayak007](https://discuss.elastic.co/u/Kayak007)
#### Post date: [March 19, 2021, 10:25am UTC](https://discuss.elastic.co/t/kibana-vega-map-signals-latitude-longitude-zoom/267796/1 "2021-03-19T10:25:12Z")

</div>

Hi,

I'm trying to modify the values of the latitude, longitude and zoom signals in order to have a global view of France and then, after a certain time (5s), zoom on a city (Paris in the example below). And back to the original view, and zoom, ...  
And I'm getting various results, but not the one I want.

Here's the code:

```auto
{
	$schema:https://vega.github.io/schema/vega/v5.17.0.json

	config:{
		kibana:{
			type:map
			zoom:5.5
			latitude:46.5
			longitude:3.15
			delayRepaint:true
		}
	}

	signals:[
		{name:"scheduler",init:'0',on:[{events:"timer{5000}",update:"if(scheduler==2,0,scheduler+1)"}]}
		{name:"longitude",update:"if(scheduler=='0'||scheduler=='2',3.15,2.325)"}
		{name:"latitude",update:"if(scheduler=='0'||scheduler=='2',46.5,45.61)"}
		{name:"zoom",update:"if(scheduler=='0'||scheduler=='2',5.5,10)"}
	]
}

```

When checking the signal values with `VEGA_DEBUG.view.getState()`, they are coherent with the code but the visualisation doesn't follow.  
Each signal change independently functions.  
But if I try all of them at the same time, depending on their order in the signals block, I can see a mix of changes (ex.: only zoom, or zoom and latitude but not longitude...) but not all three.  
Tried by using a different timer signal for each signal, but no change.

Also, when for example latitude and longitude changes are taken into account, I see the visualisation move first for latitude, then for longitude. The visualisation doesn't "jump" directly to the new (latitude, longitude).  
Is there a way to make the move "smoothly"?

Regards.

---

<div class="post-metadata">

### Author: ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)
#### Post date: [March 22, 2021, 2:10pm UTC](https://discuss.elastic.co/t/kibana-vega-map-signals-latitude-longitude-zoom/267796/2 "2021-03-22T14:10:28Z")

</div>

This question might be better suited on the [Vega GitHub Issues](https://github.com/vega/vega/issues) page.

If you look at this in the [Vega Editor](https://vega.github.io/editor/#/url/vega/N4IgJAzgxgFgpgWwIYgFwhgF0wBwqgegIDc4BzJAOjIEtMYBXAI0poHsDp5kTykSArJQCMAdkoAGSgCsIbAHYgANCCgKAZjTJpQAaxpMk8lKlCYAnjjhoQyHMpAAvNmwRohAlQBskmOgwATa1QAFgA2Sk8QLwVaTEDggGYRKKCfcwAlOBwkGnlMNEwAJwY4AF8ylQgtYy8INABtUGMEYJAuOACGLzgihzy6GwkHBUbQOFJ8+vQ-VqLgAQklsocGHADfNpp1AAoOrp6igF4jgCYlCSV97t6AamEAShAygF1K5qRWmxj5OITV9abGzbPawTo3Y5HADkEihAB84ddDicoacoUpksJPKdKIlTgInu8QC02j4-PEggCNpgtrskb0UbCEfTIaj0eFIkoQkIwo9nkoPl90M5XFSgegQSzGfDEWCDgzoWilB4lMIJIS3kA) and click on Signal View and Record Signal Changes you can see they all change independently so it appears that is normal functionality built into Vega.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/a/dab2d8af89093fe1b1b77de0bc00c942589e5fa5.png)

My only guess right now would possibly make the data into an array and just call the specific element. So the data would all update at the same time and you just reference the element you needed. Not even sure if that's possible, just saying that is what I would explore.

---

<div class="post-metadata">

### Author: ![Kayak007](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kayak007/32/147597_2.png) [@Kayak007](https://discuss.elastic.co/u/Kayak007)
#### Post date: [March 23, 2021, 8:34am UTC](https://discuss.elastic.co/t/kibana-vega-map-signals-latitude-longitude-zoom/267796/3 "2021-03-23T08:34:02Z")

</div>

Hi,

Thanks for the answer.  
Not used to the Vega Editor, I'll have a look at it.  
And post an issue on Vega GitHub.

Regards.

---

<div class="post-metadata">

### Author: ![Kayak007](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kayak007/32/147597_2.png) [@Kayak007](https://discuss.elastic.co/u/Kayak007)
#### Post date: [March 24, 2021, 1:37pm UTC](https://discuss.elastic.co/t/kibana-vega-map-signals-latitude-longitude-zoom/267796/4 "2021-03-24T13:37:41Z")

</div>

Hi,

I took a closer look at the vega documentation and it seems that signals are updated sequentially. So the behaviour is normal...

Still I managed to do what I wanted by creating the following signal:

```auto
{name:"sigrepaintMap",on:[{events:"timer{2000}",update:"setMapView([sigLongitude,sigLatitude],sigZoom)"}]}

```

`setMapView()` modifies all three signals at the same time.

The info was found here: [GitHub - nyurik/leaflet-vega: Leaflet layer based on Vega visualization grammar](https://github.com/nyurik/leaflet-vega).

Regards.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [April 21, 2021, 1:38pm UTC](https://discuss.elastic.co/t/kibana-vega-map-signals-latitude-longitude-zoom/267796/5 "2021-04-21T13:38:29Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
