This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Peter Ng
Posted Nov 30 - Read on Facebook

Working with mapbox and wondering if anyone has an idea on how to add a framer layer to the mapbox map layer. I can add layers via: https://www.mapbox.com/mapbox-gl-js/api/#Marker but would be much better to be able to write the markers with framer layers. Any pointers would be great!

3 Comments

George Kedenburg III

hmmm quick guess but try something like this:
markerLayer = new Layer
new Marker(element: markerLayer._element)

Koen Bok

Paul Veugen can anyone at MapBox maybe help Peter from Uber?

Alan Dickinson

Hey Peter, if you want the markers to move with the map when zooming, changing pitch, etc. you'll need to setup some projection methods to convert lat/lng to the new x,y coordinates in your Framer markers layer. d3 has a couple examples that both use the same open source projection method to do this (from Uber! 😀).
https://bl.ocks.org/enjalot/1ed5d9795b82f846759f89029b0b8ff3
http://bl.ocks.org/enjalot/fb7f3d696167e9b83a72

viewport-mercator-project: https://github.com/uber-common/viewport-mercator-project

I've been working on something similar and happy to share when I'm done.

Read the entire post on Facebook