[Vega] Function setMapView not recognized anymore

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.

Hi,

Upgrade to 7.16.3 and setMapView still NOK...

Regards.

Can you supply your vega script from 7.10?

Hi,

Thanks for your answer.

Here goes for the part where setMapView is used:

	$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]([Kibana/Vega] Map signals latitude, longitude & zoom - #4 by Kayak007).

Regards.

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

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

Thanks.

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