(RDMLX) Web View HTML Map Links

Please do not use to report errors- use your regional help desk.
Please mark posts as being for RPG or RDMLX (LANSA) developer.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
Post Reply
edwardtn
Posts: 33
Joined: Fri Aug 28, 2015 11:53 pm

(RDMLX) Web View HTML Map Links

Post by edwardtn »

Hello,

My application is using local html and JavaScript in Web Views to access local data for offline use. When using email, phone, and SMS links the app(s) handle (intercept) the links correctly and use the native email/phone/messaging applications. Map links do not seem to be intercepted (on any platform) and open a Google Maps URL in the Web View.

I am formatting my Map Links according to the Apple iOS Developer URL Scheme: https://developer.apple.com/library/ios ... Links.html

Is there any specific way LongRange is expecting to use Map Links in a Web View to ensure they are opened in the native Map application? Or, is there a native map API that is available via JavaScript?

Thanks in advance!
tsupartono
Posts: 289
Joined: Wed Apr 18, 2012 10:21 am

Re: (RDMLX) Web View HTML Map Links

Post by tsupartono »

Hi Edward,
You can invoke the OpenURL operation, that should open the native Map app.
Please have a look at the JavaScript code example below (you can also directly invoke the OpenURL operation from your RPG/RDMLX code if you wish).
Let me know how you go.

Code: Select all


<head>
	<script language=javascript>

	function openMap()
	{
		var options =
		{
			operation:
			{
				type: "openurl",
				url: "http://maps.apple.com/?q=122+Arthur+St+North+Sydney"
			}
		};
		LONGRANGE.Form.runOperation(options);
	}
	</script>

</head>

</script>
<body>
	<button onclick="openMap()">Click Me!</button>
</body>

edwardtn
Posts: 33
Joined: Fri Aug 28, 2015 11:53 pm

Re: (RDMLX) Web View HTML Map Links

Post by edwardtn »

Hi Tony,

Sorry for the late response. This solution worked perfectly...exactly what I needed.

Thanks!

Edward
Post Reply