URL Scheme overview

NAVER Maps URL Scheme helps you launch the NAVER Maps app in other apps or web pages to execute various map features including marking places, search, directions and navigation.

Getting started with URL Scheme

Basic information

NAVER Maps URL Scheme starts with nmap://, as shown in the following URL structure.

nmap://actionPath?parameter=value&appname={YOUR_APP_NAME}

You can specify the type of feature in actionPath, and required parameters for each feature in parameter=value. Refer to the description of parameters for each feature, for more information.

appname

appname is a character string to identify apps or web pages using URL Scheme. Every URL must include the appname parameter. Available values are as follows.

  • Android: App’s applicationId
  • iOS: App’s bundle ID
  • Web page: Web page URL

Display main screen

Displays the NAVER Maps app’s main screen.

Action path

/map
Parameter
Parameter Type Required Description
lat double N Center latitude of the map.
- Input range: 31.43-44.35
- Default: The app’s previous status remains the same.
lng double N Center longitude of the map.
- Input range: 122.37-132.00
- Default: The app’s previous status remains the same.
zoom double N Zoom level of the map.
- Input range: 4-20
- Default: The app’s previous status remains the same.
Example

The following example displays the NAVER Maps app’s main screen without additional parameters.

nmap://map?&appname=com.example.myapp

The following map is displayed as a result.

Without additional parameters specified

The following example displays the NAVER Maps app’s main screen by specifying the center coordinates to (37.4979502, 127.0276368) and the zoom level to 20.

nmap://map?lat=37.4979502&lng=127.0276368&zoom=20&appname=com.example.myapp

The following map is displayed as a result.

With parameters specified

Shows maps search results for specified keywords.

Action path
/search
Parameter
Parameter Type Required Description
query string Y Search keywords.
- Input: URL encoded string
Example

The following example searches maps by specifying "강남역" as a search keyword.

nmap://search?query=%EA%B0%95%EB%82%A8%EC%97%AD&appname=com.example.myapp

The following map is displayed as a result.

Search result for 강남역

Search bus

Shows bus search results for specified keywords.

Action path
/search/bus
Parameter
Parameter Type Required Description
query string Y Bus number.
- Input: URL encoded string
Example

The following example searches bus no. "222."

nmap://search/bus?query=222&appname=com.example.myapp

The following map is displayed as a result.

Search result for bus no. 222

Mark places

Adds markers on the specified coordinates.

Action path
/place
Parameter
Parameter Type Required Description
lat double Y Latitude.
- Input range: 31.43-44.35
lng double Y Longitude.
- Input range: 122.37-132.00
name string Y Name.
- Input: URL encoded string
Example

The following example adds a marker that reads "경기도 성남시 분당구 정자동" on the coordinates, (37.4979502, 127.0276368).

nmap://place?lat=37.4979502&lng=127.0276368&name=%EA%B2%BD%EA%B8%B0%EB%8F%84%20%EC%84%B1%EB%82%A8%EC%8B%9C%20%EB%B6%84%EB%8B%B9%EA%B5%AC%20%EC%A0%95%EC%9E%90%EB%8F%99&appname=com.example.myapp:

The following map is displayed as a result.

Marker added on the map

Directions

Directions for transit

Gets directions for public transit.

Action path
/route/public
Parameter

Refer to Common route parameters.

Example

The following example gets transit directions from Seoul University to Olympic Park.

nmap://route/public?slat=37.4640070&slng=126.9522394&sname=%EC%84%9C%EC%9A%B8%EB%8C%80%ED%95%99%EA%B5%90&dlat=37.5209436&dlng=127.1230074&dname=%EC%98%AC%EB%A6%BC%ED%94%BD%EA%B3%B5%EC%9B%90&appname=com.example.myapp

The following directions result is displayed.

Transit directions from Seoul University to Olympic Park

Directions for driving

Gets driving directions.

Action path
/route/car
Parameter

Refer to Common route parameters.

Example

The following example gets driving directions from Seoul University to Olympic Park.

nmap://route/car?slat=37.4640070&slng=126.9522394&sname=%EC%84%9C%EC%9A%B8%EB%8C%80%ED%95%99%EA%B5%90&dlat=37.5209436&dlng=127.1230074&dname=%EC%98%AC%EB%A6%BC%ED%94%BD%EA%B3%B5%EC%9B%90&appname=com.example.myapp

The following map is displayed as a result.

Driving directions from Seoul University to Olympic Park

The following example gets driving directions from Green Factory to Seongnam city hall with a stopover in Seoul University.

nmap://route/car?slat=37.3595953&slng=127.1053971&sname=%EA%B7%B8%EB%A6%B0%ED%8C%A9%ED%86%A0%EB%A6%AC&secoords=37.359761,127.10527&dlng=127.1267772&dlat=37.4200267&dname=%EC%84%B1%EB%82%A8%EC%8B%9C%EC%B2%AD&decoords=37.4189564,127.1256827&v1lng=126.9522394&v1lat=37.464007&v1name=%20%EC%84%9C%EC%9A%B8%EB%8C%80%ED%95%99%EA%B5%90&v1ecoords=37.466358,126.948357&appname=com.example.myapp

The following map is displayed as a result.

Driving directions from Green Factory to Seongnam city hall via Seoul University

Directions for walking

Gets walking directions.

Action path
/route/walk
Parameter

Refer to Common route parameters.

Example

The following example gets walking directions from Seoul University to Dongwon Nakseongdae Apartment.

nmap://route/walk?slat=37.4640070&slng=126.9522394&sname=%EC%84%9C%EC%9A%B8%EB%8C%80%ED%95%99%EA%B5%90&dlat=37.4764356&dlng=126.9618302&dname=%EB%8F%99%EC%9B%90%EB%82%99%EC%84%B1%EB%8C%80%EC%95%84%ED%8C%8C%ED%8A%B8&appname=com.example.myapp

The following map is displayed as a result.

Walking directions from Seoul University to Dongwon Nakseongdae Apartment

Directions for bicycling

Gets bicycling directions.

Action path
/route/bicycle
Parameter

Refer to Common route parameters.

Example

The following example gets bicycling directions from Seoul University to Olympic Park.

nmap://route/bicycle?slat=37.4640070&slng=126.9522394&sname=%EC%84%9C%EC%9A%B8%EB%8C%80%ED%95%99%EA%B5%90&dlat=37.5209436&dlng=127.1230074&dname=%EC%98%AC%EB%A6%BC%ED%94%BD%EA%B3%B5%EC%9B%90&appname=com.example.myapp

The following map is displayed as a result.

Bicycling directions from Seoul University to Olympic Park

Gets navigation directions.

Action path
/navigation
Parameter

Refer to Common route parameters.

Example

The following example displays the navigation screen in safe driving mode.

nmap://navigation?&appname=com.example.myapp

The following map is displayed as a result.

Initial screen of navigation

The following example gets navigation directions from the current location to Olympic Park.

nmap://navigation?dlat=37.5209436&dlng=127.1230074&dname=%EC%98%AC%EB%A6%BC%ED%94%BD%EA%B3%B5%EC%9B%90&appname=com.example.myapp

The following map is displayed as a result.

Navigation directions from current location to Olympic Park

Common route parameters

The table below describes common parameters for directions and navigation.

Parameter Type Required Description
slat double N Latitude of the starting point.
- Input: 31.43-44.35
- Default: User’s current location
slng double N Longitude of the starting point.
- Input: 122.37-132.00
- Default: User’s current location
sname string N Name of the starting point.
- Input: URL encoded string
- Default: User’s current location
dlat double Y Latitude of the destination.
- Input: 31.43-44.35
dlng double Y Longitude of the destination.
- Input: 122.37-132.00
dname string N Name of the destination.
- Input: URL encoded string
- Default: Destination address
v1lat double N Latitude of the waypoint 1.
- Input: 31.43-44.35
- Default: No waypoint.
v1lng double N Longitude of the waypoint 1.
- Input: 122.37-132.00
- Default: No waypoint.
v1name string N Name of the waypoint 1.
- Input: URL encoded string
- Default: No waypoint.
v2lat double N Latitude of the waypoint 2.
- Input: 31.43-44.35
- Default: No waypoint.
v2lng double N Longitude of the waypoint 2.
- Input: 122.37-132.00
- Default: No waypoint.
v2name string N Name of the waypoint 2.
- Input: URL encoded string
- Default: No waypoint.
v3lat double N Latitude of the waypoint 3.
- Input: 31.43-44.35
- Default: No waypoint.
v3lng double N Longitude of the waypoint 3.
- Input: 122.37-132.00
- Default: No waypoint.
v3name string N Name of the waypoint 3.
- Input: URL encoded string
- Default: No waypoint.
v4lat double N Latitude of the waypoint 4.
- Input: 31.43-44.35
- Default: No waypoint.
v4lng double N Longitude of the waypoint 4.
- Input: 122.37-132.00
- Default: No waypoint.
v4name string N Name of the waypoint 4.
- Input: URL encoded string
- Default: No waypoint.
v5lat double N Latitude of the waypoint 5.
- Input: 31.43-44.35
- Default: No waypoint.
v5lng double N Longitude of the waypoint 5.
- Input: 122.37-132.00
- Default: No waypoint.
v5name string N Name of the waypoint 5.
- Input: URL encoded string
- Default: No waypoint.

Matters to be handled for URL Scheme

When NAVER Maps URL Scheme is called on your web page or app, the NAVER Maps app is launched to handle URL Scheme requests. If users do not have the NAVER Maps app installed on their devices, you should prompt them to install it by redirecting them to the installation page of the app in the App Store or Google Play.

Mobile app

Android

Call queryIntentActivities) as shown in the following code snippet to check if the NAVER Maps app is installed, and if not, redirect the user to the Google Play store.

String url = "nmap://actionPath?parameter=value&appname={YOUR_APP_NAME}";

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
intent.addCategory(Intent.CATEGORY_BROWSABLE);

List<ResolveInfo> list = getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
if (list == null || list.isEmpty()) {
    context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.nhn.android.nmap")));
} else {
    context.startActivity(intent);
}

iOS

Create LSApplicationQueriesSchemes in info.plist and add nmap.

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>nmap</string>
</array>

Call canOpenURL as shown in the following code snippet to check if the NAVER Maps app is installed, and if not, redirect the user to the App Store.

let url = URL(string: "nmap://actionPath?parameter=value&appname={YOUR_APP_NAME}")!
let appStoreURL = URL(string: "http://itunes.apple.com/app/id311867728?mt=8")!

if UIApplication.shared.canOpenURL(url) {
  UIApplication.shared.open(url)
} else {
  UIApplication.shared.open(appStoreURL)
}

Mobile web page

Android

You can use Intent URL to automatically redirect users to the Google Play store if they do not have the app installed. The structure of an intent URL is as follows.

intent://actionPath?parameter=value&appname={YOUR_APP_NAME}#Intent;scheme=nmap;action=android.intent.action.VIEW;category=android.intent.category.BROWSABLE;package=com.nhn.android.nmap;end

The following example adds a marker that reads "경기도 성남시 분당구 정자동" on the coordinates, (37.4979502, 127.0276368), by using an intent URL.

intent://place?lat=37.4979502&lng=127.0276368&name=%EA%B2%BD%EA%B8%B0%EB%8F%84%20%EC%84%B1%EB%82%A8%EC%8B%9C%20%EB%B6%84%EB%8B%B9%EA%B5%AC%20%EC%A0%95%EC%9E%90%EB%8F%99&appname=com.example.myapp#Intent;scheme=nmap;action=android.intent.action.VIEW;category=android.intent.category.BROWSABLE;package=com.nhn.android.nmap;end

iOS

You can use the JavaScript timer to move to the App Store as shown in the following code.

<script>
function openNaverMapApp(url) {
    var clickedAt = +new Date();

    location.href = url;

    setTimeout(function() {
        if (+new Date() - clickedAt < 2000) {
            location.href = 'http://itunes.apple.com/app/id311867728?mt=8';
        }
    }, 1500);
}

window.onload = function() {
    openNaverMapApp("nmap://actionPath?parameter=value&appname={YOUR_APP_NAME}");
};
</script>

In-app browser

You should deal with the following to use URL Scheme in an in-app browser.

Android

Override shouldOverrideUrlLoading) of WebViewClient as shown in the following code to process URL Scheme.

@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
    if (url.startsWith("intent:")) {
        Intent intent;
        try {
            intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME);
        } catch (URISyntaxException e) {
            return false;
        }
        if (TextUtils.isEmpty(intent.getPackage())) {
            return false;
        }
        List<ResolveInfo> list = getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
        if (list == null || list.isEmpty()) {
            startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + intent.getPackage())));
        } else {
            startActivity(intent);
        }
        return true;
    }

    return false;
}

iOS

Add the code to process URL Scheme to decidePolicyFor of WKWebview as shown in the following code.

func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
    if let url = navigationAction.request.url {
        if url.scheme == "nmap" {
            UIApplication.shared.open(url)
            decisionHandler(.cancel)
            return
        }
    }
    decisionHandler(.allow)
}

results matching ""

    No results matching ""

    Processing...