# \[Vega\] Function setMapView not recognized anymore

**URL:** https://discuss.elastic.co/t/vega-function-setmapview-not-recognized-anymore/296983
**Category:** Kibana
**Tags:** vega, maps
**Created:** [February 11, 2022, 2:09pm UTC](https://discuss.elastic.co/t/vega-function-setmapview-not-recognized-anymore/296983 "2022-02-11T14:09:53Z")
**Posts on this page:** 7
**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: [February 11, 2022, 2:09pm UTC](https://discuss.elastic.co/t/vega-function-setmapview-not-recognized-anymore/296983/1 "2022-02-11T14:09:53Z")

</div>

Hi,

Some time ago, when using 7.10.x, I used to use (...) the function _ **setMapView** _ in Vega visualizations in order to modify signals latitude, longitude and zoom simultaneously.

I hadn't looked at these in quite some time.

We're now in 7.13.2 and I get a _\> Unrecognized function: setMapView_ message.

Is this a bug?  
As setMapView been replaced? Deleted?

Thanks.

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: [February 24, 2022, 9:17am UTC](https://discuss.elastic.co/t/vega-function-setmapview-not-recognized-anymore/296983/2 "2022-02-24T09:17:10Z")

</div>

Hi,

Upgrade to 7.16.3 and _setMapView_ still NOK...

Regards.

---

<div class="post-metadata">

### Author: ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)
#### Post date: [February 24, 2022, 10:47pm UTC](https://discuss.elastic.co/t/vega-function-setmapview-not-recognized-anymore/296983/3 "2022-02-24T22:47:32Z")

</div>

Can you supply your vega script from 7.10?

---

<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: [February 25, 2022, 8:27am UTC](https://discuss.elastic.co/t/vega-function-setmapview-not-recognized-anymore/296983/4 "2022-02-25T08:27:54Z")

</div>

Hi,

Thanks for your answer.

Here goes for the part where setMapView is used:

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

	config:
	{
		kibana:
		{
			type: map
			zoomControl: false 
			scrollWheelZoom: false 
			delayRepaint: true
			autosize: fit
		}
		legend:
		{
			direction: vertical
			fillColor: rgb(255, 255, 255)
			strokeColor: rgb(0, 0, 0)
			padding: 10
			titleFontSize: 12
			titlePadding: 3
		}
	}

	signals:
	[
		{
			name: "sigScheduler",
			init: "0",
			"on": 
			[
				{
					"events": "timer{4000}",
					"update": "if(sigScheduler==7, 0, sigScheduler+1)"
				}
			]
		}
		{
			name: "sigLatitude",
			update: "data('zoomData')[sigScheduler].latitude"}
		{
			name: "sigLongitude", 
			update: "data('zoomData')[sigScheduler].longitude"}
		{
			name: "sigZoom", 
			update: "data('zoomData')[sigScheduler].zoom"}
		{
			name: "sigrepaintMap", 
			on: 
			[
				{
					events: "timer{2000}",
					update: "setMapView([sigLongitude, sigLatitude], sigZoom)"
				}
			]
		}
	]

```

Signal _ **sigScheduler** _ browses through values 0 to 7, which updates signals _ **sigLatitude** _, _ **sigLongitude** _ and _ **sigZoom** _ according to the respective item in the dataset _ **zoomData** _.  
Then, _ **SetMapView** _ changes the Latitude, Longitude and Zoom level based on the signal values.

Used to be OK, but now I only get the message:

> Unrecognized function: SetMapView

That's what I had posted as a solution to a previous question [[[Kibana/Vega] Map signals latitude, longitude & zoom](https://discuss.elastic.co/t/kibana-vega-map-signals-latitude-longitude-zoom/267796)]([[Kibana/Vega] Map signals latitude, longitude & zoom - #4 by Kayak007](https://discuss.elastic.co/t/kibana-vega-map-signals-latitude-longitude-zoom/267796/4)).

Regards.

---

<div class="post-metadata">

### Author: ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)
#### Post date: [February 28, 2022, 1:48pm UTC](https://discuss.elastic.co/t/vega-function-setmapview-not-recognized-anymore/296983/5 "2022-02-28T13:48:50Z")

</div>

Hi @Kayak007, thanks for reporting this. It appears that the `setMapView` function was not carried over when we switched from leaflet to mapbox-gl. I've opened an issue to track this. [[Vega] Support `setMapView` expression for Vega Maps · Issue #126459 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/126459)

To help us prioritize this issue, you can add your comments to the GitHub issue describing your use case.

---

<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 7, 2022, 9:01am UTC](https://discuss.elastic.co/t/vega-function-setmapview-not-recognized-anymore/296983/6 "2022-03-07T09:01:29Z")

</div>

Thanks.

---

<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 4, 2022, 9:02am UTC](https://discuss.elastic.co/t/vega-function-setmapview-not-recognized-anymore/296983/7 "2022-04-04T09:02:15Z")

</div>

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