skip to Main Content

Dev Tip: Create a Google Maps link in SAPUI5

Dev Tip: Create a Google Maps link in SAPUI5
In case you’ve missed our dev tips in past weeks, we will be posting them in the blog moving forward. To sign up and get your dev tips delivered to your inbox each week, click here!

Tip of the Week

Create a Google Maps link in SAPUI5

With UI5 applications being accessed by web on computers, laptops, and tablets, one easy feature to implement that helps take advantage of the benefits of being web-enabled is to create links from addresses. You can also create links from phone numbers and emails, making it easier to contact people from UI5 applications than with traditional GUI screens.

It turns out, creating a link to Google Maps is quite easy. Take a look at the code snippet below.

That’s all it takes! On line 7 we specify a “Link” in our view. The “text” property will control the link text that’s displayed in the app. The “href” property is the URL we want to go to. For Google Maps searches, the pattern is “https://maps.google.com/?q=<term>” where <term> represents your search term. This could be an address, or in our example, a building name. The “target” property being set to “_blank” opens the link in a new tab. Below we see our app, and the Google Maps window we opened.

For more on links, check out the API reference documents, and help make your UI5 apps actionable!

https://sapui5.hana.ondemand.com/#/api/sap.m.Link

 

If you have an interest in viewing similar content, visit our blog, here

View our LinkedIn, here

Dan Flesher is an experienced SAP UX Architect and Design Thinker. He began his SAP career as an ABAP developer, and transitioned to a focus on SAPUI5 and Gateway OData service development. In addition to his development background, Dan has a passion for Digital Transformation, and Design Thinking, helping clients with their trickiest challenges. With a user-centered focus, Dan is typically involved in all stages of projects, from design workshops and prototyping, through development and delivery. Dan is a frequent speaker at ASUG and SAP UX events, and contributes blogs and development tips through the SAP UX newsletter and the Mindset blog.

Back To Top