Closed nikischin closed 7 months ago
This looks strange, thank you for reporting it! A workaround you can use for now is to set includedPOICategories
to []
.
It does work if I replace this line
with
delete map.pointOfInterestFilter;
However, as I get a TS error ts(2790)
if I remove the ts ignore, I am not sure if this might cause some other issues maybe?
@Nicolapps could you have a look at it maybe? :)
I figured out, mapkit-js generates quite some service calls while generating very few map calls. Apple limits the number of service calls to 25K while limiting the map calls to 250K, so someone using this lib more heavily might encounter some service call limits quite some time before the map call limits. In my experience I have like 50-100% more service calls than map calls. I haven't yet figured out the exact reason, though it seems like most interactions within the map (moving the visible area) are considered a service call. Not sure if it is connected with this issue also which could be responsible for some of the service calls, maybe it doesn't make a difference.
@Nicolapps Could you have a look at my previous comment or should I just open a PR for it? :)
Thank you!
Hey, thank you for your observation. Does it look like from your data that the way mapkit-react works in order to set properties increase billed usage? If it is the case, we could try to find a way to handle initial state differently (i.e. pass these options to the constructor instead of setting properties). I would rather avoid doing this if it doesn’t matter since it will make the code more complicated, but it could be interesting if the current solution has a monetary cost.
I further investigated, however, I still cannot tell for sure what creates service requests and what doesn't.
In any case though it seems a lot like without the showsPointsOfInterests
it does generate some fewer service requests (but still some), than with those enabled. I personally in my implementation would want them to be disabled for other reasons, so would be happy if this fix (or any other fix for this issue) would be approved.
Thank you so much!
The param
showsPointsOfInterest
is not considered in the initial load, however working if the param is refreshed. Easily reproducable at the Storybook.Steps to reproduce:
Map > Empty
orMap > Custom Appearance
storybook.showsPointsOfInterest
tofalse
Remount Component
buttonCurrent behavior: Points of interest are again visible
Expected behavior: Points of interest are not visible