Hello,
My current web has a map with OSM as a base layer with a global search functionality.
I'm interested in integrating the full ecosystem of ESRI, like Location Services (country-specific geocoding), spatial analysis, and the ArcGIS dashboard. I also have a partner who is subscribed to ESRI and has built an ESRI layer that I intend to import to my app.
In a nutshell, what would be the best approach to fully integrate these features?
Thanks!
Hello Barely.
The question would be: what is the best way to replace the free OpenStreetMap with the entire ESRI ecosystem to get access to more advanced features and data.
Given the context of your question, the core issue is how you structure the application to integrate with the ESRI APIs, correct?
The best approach will depend on a few factors, but we can outline a general path using OutSystems engineering and architecture best practices.
The Best Approach: A Modular Solution
The most appropriate answer, aligned with OutSystems best practices, is to create a modular solution. This means you don't place all the integration logic directly in the main application. Instead, you create dedicated support modules.
Step 1: Create a Core Services Module
Name: ESRI_Core_Services (or something similar).
Purpose: This module will serve as the "bridge" between your OutSystems application and the ESRI services. It should encapsulate all the communication logic with the APIs.
Content:
REST API Consumption: Create all the methods here to call the ESRI APIs. For example: GeocodeAddress (for geocoding), PerformSpatialAnalysis, GetArcGISLayerData.
Authentication: Manage access keys or tokens. A recommended practice is to store these credentials in Site Properties to make management easier across different environments (Development, Test, Production) without requiring a new deployment.
Data Structure: Define the data structures for the requests and responses from the ESRI APIs. This makes the code cleaner and easier to maintain.
Error Handling: Implement robust error handling to manage connection failures or errors returned by the ESRI APIs.
Step 2: Create a UI Components Module
Name: ESRI_UI_Components (or similar).
Purpose: This module should contain reusable widgets, blocks, and UI patterns to display map data.
Map Block: A block that encapsulates the ESRI map. Inside, you'd use JavaScript to initialize the map, add layers (including your partner's), and interact with it. This block should be able to receive the ArcGIS layer URL as an input parameter.
Search Box Widget: A global search widget that calls the geocoding method from the ESRI_Core_Services and updates the map position.
Analysis Widgets: Blocks to display spatial analysis results, such as charts or specific information.
Step 3: Connect Everything in the Main Application Module
In your main module (MyWebsite or similar), reference the blocks and actions from the ESRI_Core_Services and ESRI_UI_Components modules.
On the screen that needs the map, drag the Map Block and the Search Box Widget.
Pass your partner's ESRI layer URL as a parameter to the Map Block.
Hi Barely Coding, maybe you could have a look at these Forge Components? https://www.outsystems.com/forge/component-overview/10998/esri-maps-reactive-o11
https://www.outsystems.com/forge/component-overview/8391/esri-maps-o11
Kind regards