NYCPlanning / labs-applicantmaps

5 stars 5 forks source link

[Annotations] Arrow doesn't show up until user draws another annotation #504

Closed trbmcginnis closed 5 years ago

trbmcginnis commented 5 years ago

When a user draws their first annotation, the arrows will not fully show up (sometimes there's one arrow, sometimes there's none).

Zooming in and out will make the arrows disappear and reappear.

The arrows on that first annotation will show up permanently when:

trbmcginnis commented 5 years ago

An example where one arrow showed up:

Screen Shot 2019-03-15 at 10.54.27 AM.png

trbmcginnis commented 5 years ago

An example where no arrows showed up:

Screen Shot 2019-03-15 at 10.58.08 AM.png

hannahkates commented 5 years ago

They also appear/disappear depending on the zoom level, without drawing a new annotation. See gif below Mar-15-2019 11-28-13

ghost commented 5 years ago

oh weird! maybe this can be fixed with just styling ! great catch, @hannahkates

chriswhong commented 5 years ago

I believe this is due to the image for the arrowhead not being added to the map in time.

The icon gets added using https://docs.mapbox.com/mapbox-gl-js/api/#map#addimage, I am not sure how, but I think we need to confirm that it's available before trying to render things that use it.

hannahkates commented 5 years ago

Closing, looks like this was fixed successfully.