Open kpagcha opened 2 years ago
@kpagcha What is the mapboxgl
variable?
I'm having a different issue but wondering what that variable actually points to, or equals. Trying to figure out if my map is not the correct instance type.
map.addControl(new MapboxGeocoder({
accessToken: mapboxgl.accessToken,
mapboxgl: mapboxgl, <= What is this?
coords: new mapboxgl.Marker({draggable: true}).setLngLat(coords)
}), 'top-left');
@just-Bri well that's just how the mapbox-gl-geocoder docs tell you to initialize the component. But mapboxgl
is just the object you get when importing the mapbox-gl.js library.
@kpagcha As in it's a mapboxgl.Map
right?
I'm having issues using react-map-gl, but I'm not sure if this specific piece has anything to do with it.
A coworker of mine pointed out that it might be a bad import/export somewhere but I can't find any in our code, haven't checked the source for mapbox-gl-geocoder yet though.
I'm trying to use with plugin as a widget to input geolocation of a venue. But I have two requirements:
options.marker
accepts aBoolean
or anObject
. I assumed the intent of the latter was precisely to pass an existing marker instance to use when searching. However, I've tried doing this and no initial marker is being shown on the map: