Skip to content

Feature/prd 504 Remove routing bridge between MapView and native SDK#647

Open
adrian-situm wants to merge 53 commits into
developfrom
feature/PRD-504
Open

Feature/prd 504 Remove routing bridge between MapView and native SDK#647
adrian-situm wants to merge 53 commits into
developfrom
feature/PRD-504

Conversation

@adrian-situm

Copy link
Copy Markdown

No description provided.

situmops and others added 30 commits February 20, 2026 11:53
Automatic merge into master to Release 3.18.6
Automatic merge into master to Release 3.18.7
Automatic merge into master to Release 3.18.8
Automatic merge into master to Release 3.18.9
Automatic merge into master to Release 3.18.10
Automatic merge into master to Release 3.18.11
Automatic merge into master to Release 3.18.12
Automatic merge into master to Release 3.18.13
Automatic merge into master to Release 3.18.14
Automatic merge into master to Release 3.18.15
Automatic merge into master to Release 3.18.16
Automatic merge into master to Release 3.18.17
Automatic merge into master to Release 3.18.18
Automatic merge into master to Release 3.18.19
Automatic merge into master to Release 3.18.20
Automatic merge into master to Release 3.18.21
Automatic merge into master to Release 3.18.22
Automatic merge into master to Release 3.18.23
Automatic merge into master to Release 3.18.24
Automatic merge into master to Release 3.18.25
Automatic merge into master to Release 3.18.26
const receivedError = internalCall.get<Error>();
dispatch(setError(receivedError));
break;
case InternalCallType.NAVIGATION_START:

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aquí llegaban los mensajes que enviaba el InternalCall, también se eliminan porque ya no se desea informar al viewer de estos cambios

);
}

const calculateRoute = async (

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Esta lógica era llamada por el MapView cuando recibía mensajes del viewer relacionados con la navegación y las rutas

},
setNavigation: (state: State, payload: State["navigation"]) => {
return { ...state, navigation: payload };
},

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Se utilizaban por el bridge para actualizar el estado de la store al hacer ruta y navegación por medio del sdk

currentBuilding: undefined,
pois: [],
directions: undefined,
navigation: undefined,

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Desde que se cambio el viewer para calcular las rutas desde javascript, esto se queda siempre en undefined. Ojo que si algún cliente los tenía en el código (aunque ya no funcionaban) podría lanzar error de typescript

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Si se rompe compatibilidade hai que ter coidado. Eu deprecaría en primeiro lugar e nunha release posterior eliminaría. É unha putada, pero é o proceso a seguir.
@fsvilas que opinas?
Certo é que non creo que nadie acceda a esto...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Si eu marcaria como deprecada e indicaria que nunca vai recibir ningún valor, pero que se manten para non romper compatibilidad.
Se fixeramos nun futuro proximo un release que cambie o major (guiño, guiño), sí que se podería eliminar.

export const selectNavigation = (state: State) => {
return state.navigation;
};

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Se ha borrado el state.directions y state.navigation, no tiene sentido mantener los selects

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O mismo que arriba.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sep, deixaria os métodos inda que non fagan nada e marcariaos como deprecados

cancelNavigation: () => void;
setOnDirectionsRequestInterceptor: (params: {
onDirectionsRequestInterceptor: OnDirectionsRequestInterceptor;
}) => void;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Esto era una función que cambiaba un parámetro del MapView para guardar un Interceptor. Este Interceptor era una función a la que calculateRoute llamaba para modificar o capturar la información de la ruta

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Igual: tecnicamente é unha función pública da API, primeiro habería que deprecala e despois eliminala.
Nadie debería estar usando esto... non sei que pensar. @fsvilas ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O mesmo

),
);
};

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Se utilizaban exclusivamente en calculateRoute

// Navigation
navigation: (navigation: Navigation) => {
return mapperWrapper(`navigation.${navigation.status}`, navigation);
},

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Estas eran funciones que convertían un objeto en un mensaje para el viewer. El viewer ya no capta estos mensajes, así que se borran.

navigation,
calculateRoute,
startNavigation,
stopNavigation,

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Se han borrado estos estados y funciones de la store, sincronizaban la navegación y rutas del sdk con el viewer

) => {
const webViewRef = useRef<WebView>(null);
const [_onDirectionsRequestInterceptor, setInterceptor] =
useState<OnDirectionsRequestInterceptor>();

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

El Interceptor permitía modificar los valores de una ruta antes de calcularse. Ya no se usa el sdk para calcularse así que no tiene sentido dejarlo.


sendMessageToViewer(webViewRef.current, ViewerMapper.route(directions));
}, [directions, mapLoaded]);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enviaban mensajes al viewer cuando la navegación o ruta de la store cambiaban. Se borraron estos valores de la store, así que de aquí también.

/** Point to, where the route should end */
to: Point | Poi;
} & DirectionsOptions;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solo se usaba en createDirectionsRequest y en el Interceptor, ambos eliminados

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Esto non estou convencido de que poidamos eliminalo:

  1. Pertence á API pública, por tanto un cliente podería estar usándoo aínda que nós non o fagamos como tal.
  2. Probablemente tería sentido engadir unha sobrecarga de requestDirections que reciba como parámetro este tipo.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

É unha cousa rara porque como di Roi despois requestDirections:
static requestDirections = ( building: Building, from: Point | Location, to: Point | Poi, directionOptions?: DirectionsOptions, ) => { return promiseWrapper<Directions>(({ onSuccess, onError }) => { const params = [building, from, to, directionOptions || {}]; RNCSitumPlugin.requestDirections(params, onSuccess, onError); }); };
non usa ese obxeto.
Como di Roi eu sobrecargaria o metodo para usalo e incluso poderia valorarse deprecar o antigo

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lo estuve mirando y parece que habría que hacer cambios en la implementación nativa. De momento lo reintroduzco y dejo como está, si queréis lo podemos mirar.

"Situm > hook > Navigation on course, poi category selection is unavailable",
);
return;
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SitumPlugin.navigationIsRunning() comprueba si el SDK está utilizando la navegación, como ya no va sincronizado con el viewer no tiene usarlo aquí

},
cancelNavigation(): void {
if (!webViewRef.current) return;
stopNavigation();

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stopNavigation detenía la navegación en el SDK y actualizaba la store, esto se borra y se deja el sendMessageToViewer, que es el método moderno, para que se pueda seguir deteniendo la navegación por medio de esta función

/** Point to, where the route should end */
to: Point | Poi;
} & DirectionsOptions;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Esto non estou convencido de que poidamos eliminalo:

  1. Pertence á API pública, por tanto un cliente podería estar usándoo aínda que nós non o fagamos como tal.
  2. Probablemente tería sentido engadir unha sobrecarga de requestDirections que reciba como parámetro este tipo.

Comment thread plugin/src/sdk/types/constants.ts Outdated

/**
* Available accessibility modes used in the {@link DirectionsRequest}.
* Available accessibility modes used when calculating routes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aquí creo que había unha confusión, o tipo correcto era DirectionsOptions, non DirectionsRequest (un está dentro do outro, é un pouco confuso)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bien visto, lo cambio

Comment thread plugin/src/sdk/index.ts
};

const _internalNavigationProgressCallback = (progress: NavigationProgress) => {
internalMethodCallMapDelegate(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ten sentido manter a callback interna? Non se podería eliminar e usar directamente a callback de cliente? Igual para os casos de abaixo.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claro, aplicaré el cambio

currentBuilding: undefined,
pois: [],
directions: undefined,
navigation: undefined,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Si se rompe compatibilidade hai que ter coidado. Eu deprecaría en primeiro lugar e nunha release posterior eliminaría. É unha putada, pero é o proceso a seguir.
@fsvilas que opinas?
Certo é que non creo que nadie acceda a esto...

export const selectNavigation = (state: State) => {
return state.navigation;
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O mismo que arriba.

cancelNavigation: () => void;
setOnDirectionsRequestInterceptor: (params: {
onDirectionsRequestInterceptor: OnDirectionsRequestInterceptor;
}) => void;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Igual: tecnicamente é unha función pública da API, primeiro habería que deprecala e despois eliminala.
Nadie debería estar usando esto... non sei que pensar. @fsvilas ?

* This interface allows you to modify all the parameters in the DirectionRequest used by the MapViewer to calculate the route.
* To use this you will need to load the MapView and once it ends loading use the MapViewRef that you obtain an call setOnDirectionsRequestInterceptor(interceptor)
*/
export interface OnDirectionsRequestInterceptor {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Máis do mismo.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sep

selectPoi: (poiId: number | null) => {
return mapperWrapper(`cartography.select_poi`, { identifier: poiId });
},
deselectPoi: () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Este método existe nalgunha outra plataforma (ex. flutter)? Está ben, pero é API pública e si existe debe chamarse igual, usarse igual, etc.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Esto lo acabo de meter hace unos minutos porque haciendo el plan de prueba descubrí que el deselectPoi que había en el MapView no funcionaba. No he añadido ninguna interfaz publica, solo he arreglado una función imperativa del MapView que no funcionaba.

@adrian-situm adrian-situm changed the title Feature/prd 504 Removed routing bridge between MapView and native SDK Feature/prd 504 Remove routing bridge between MapView and native SDK Jul 22, 2026
navigation?: Navigation;
error?: Error;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Entendo que o mesmo tamen para estos tres

destinationIdentifier: string;
destinationCategory: string;
identifier: string;
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O mesmo

Comment thread CHANGELOG_UNRELEASED.md Outdated

### Removed

- Removed routing and navigation bridge between MapView and native SDK.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explicar esto mellor, esto faise porque agora o mapView nunca vai usar a navegación do sdk

@R-lagoman R-lagoman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aprobada, pero porfa revisa ese último comentario que puxen.

@@ -1,17 +1,3 @@
export enum NavigationStatus {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Estame vindo á cabeza que esta enum quizais estivera aí unicamente para ser usada desde o lado cliente, para que dispoña dun listado exhaustivo de estados. Quizais non atopaches usos no código por eso. Pode ser?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tenía usos en el puente que se eliminó, pero me suena bastante realista pensar que un integrador podría haberlo usado. Lo vuelvo a añadir como deprecado. Si consideras que no debería estar deprecado avísame y lo cambio sin problema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants