Skip to content

Conversation

tomchadwin
Copy link
Collaborator

@tomchadwin tomchadwin commented Dec 1, 2017

Updated from #68, with deduplicating for labels added to example.

@pkozul
Copy link

pkozul commented May 5, 2020

Hi Tom,

I've used some of the code from this PR. Good work! I only needed to make one small change - provide the zoom level parameter when calling map.unproject().

	vtGeometryToLatLng: function(geometry, vtLayer, tileCoords) {
		return this._map.unproject(this.vtGeometryToPoint(geometry, vtLayer, tileCoords), tileCoords.z);
	}

When zooming in / out, sometimes the map's current zoom level and the requested tile zoom level are not the same, and so I was noticing some of my tiles were empty (i.e. the lats / longs were being calculated incorrectly and were therefore not being dsisplayed within the visible bounds of the map). I found it was due to the above code. Without supplying the optional zoom parameter, it defaults to using the map's current zoom level, rather than using the zoom level of the tile itself (since the zoom level could be different momentarily, while the user is zooming in / out).

Might be worth including this change in the PR?

Thanks!

@zakjan
Copy link

zakjan commented Jan 23, 2021

I'm wondering what's the status of this PR, and if it can be merged and released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants