Add missing sourceDidChange event (#3421)
This commit is contained in:
2
.gitmodules
vendored
2
.gitmodules
vendored
@@ -57,7 +57,7 @@
|
||||
url = https://github.com/protomaps/PMTiles.git
|
||||
[submodule "vendor/maplibre-native-base/extras/args"]
|
||||
path = vendor/maplibre-native-base/extras/args
|
||||
url = https://github.com/Taywee/args
|
||||
url = https://github.com/Taywee/args.git
|
||||
[submodule "vendor/maplibre-native-base/extras/expected-lite"]
|
||||
path = vendor/maplibre-native-base/extras/expected-lite
|
||||
url = https://github.com/martinmoene/expected-lite.git
|
||||
|
||||
@@ -2264,6 +2264,11 @@ CLLocationCoordinate2D randomWorldCoordinate(void) {
|
||||
|
||||
// MARK: - MLNMapViewDelegate
|
||||
|
||||
- (void)mapView:(MLNMapView *)mapView sourceDidChange:(MLNSource *)source
|
||||
{
|
||||
NSLog(@"A source was updated: %@", source.identifier);
|
||||
}
|
||||
|
||||
- (void)mapView:(MLNMapView *)mapView
|
||||
shaderWillCompile:(NSInteger)id
|
||||
backend:(NSInteger)backend
|
||||
|
||||
@@ -6933,8 +6933,13 @@ static void *windowScreenContext = &windowScreenContext;
|
||||
}
|
||||
|
||||
- (void)sourceDidChange:(MLNSource *)source {
|
||||
// no-op: we only show attribution after tapping the info button, so there's no
|
||||
// interactive update needed.
|
||||
if (!_mbglMap) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ([self.delegate respondsToSelector:@selector(mapView:sourceDidChange:)]) {
|
||||
[self.delegate mapView:self sourceDidChange:source];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)didFailToLoadImage:(NSString *)imageName {
|
||||
|
||||
@@ -302,6 +302,14 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
- (void)mapView:(MLNMapView *)mapView didFinishLoadingStyle:(MLNStyle *)style;
|
||||
|
||||
/**
|
||||
Tells the delegate that the source changed.
|
||||
|
||||
@param mapView The map view that owns the source.
|
||||
@param source The source that changed.
|
||||
*/
|
||||
- (void)mapView:(MLNMapView *)mapView sourceDidChange:(MLNSource *)source;
|
||||
|
||||
/**
|
||||
Tells the delegate that the `mapView` is missing an image. The image should be added synchronously
|
||||
with ``MLNStyle/setImage:forName:`` to be rendered on the current zoom level. When loading icons
|
||||
|
||||
@@ -30,6 +30,8 @@ extension MLNMapViewDelegateIntegrationTests: MLNMapViewDelegate {
|
||||
|
||||
func mapView(_: MLNMapView, didFinishLoading _: MLNStyle) {}
|
||||
|
||||
func mapView(_: MLNMapView, sourceDidChange _: MLNSource) {}
|
||||
|
||||
func mapView(_: MLNMapView, didSelect _: MLNAnnotation) {}
|
||||
|
||||
func mapView(_: MLNMapView, didDeselect _: MLNAnnotation) {}
|
||||
|
||||
@@ -984,6 +984,11 @@ public:
|
||||
if (!_mbglMap) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ([self.delegate respondsToSelector:@selector(mapView:sourceDidChange:)]) {
|
||||
[self.delegate mapView:self sourceDidChange:source];
|
||||
}
|
||||
|
||||
// Attribution only applies to tiled sources
|
||||
if ([source isKindOfClass:[MLNTileSource class]]) {
|
||||
[self installAttributionView];
|
||||
|
||||
@@ -204,6 +204,14 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
- (void)mapView:(MLNMapView *)mapView didFinishLoadingStyle:(MLNStyle *)style;
|
||||
|
||||
/**
|
||||
Tells the delegate that the source changed.
|
||||
|
||||
@param mapView The map view that owns the source.
|
||||
@param source The source that changed.
|
||||
*/
|
||||
- (void)mapView:(MLNMapView *)mapView sourceDidChange:(MLNSource *)source;
|
||||
|
||||
/**
|
||||
Tells the delegate that the `mapView` is missing an image. The image should be added synchronously
|
||||
with ``MLNStyle/setImage:forName:`` to be rendered on the current zoom level. When loading icons
|
||||
|
||||
@@ -38,6 +38,8 @@ extension MLNMapViewDelegateIntegrationTests: MLNMapViewDelegate {
|
||||
|
||||
func mapView(_: MLNMapView, didFinishLoading _: MLNStyle) {}
|
||||
|
||||
func mapView(_: MLNMapView, sourceDidChange _: MLNSource) {}
|
||||
|
||||
func mapViewWillStartRenderingFrame(_: MLNMapView) {}
|
||||
|
||||
func mapViewWillStartRenderingMap(_: MLNMapView) {}
|
||||
|
||||
Reference in New Issue
Block a user