I want the address I entered on the Naver map to be marked with a marker.

Asked 2 years ago, Updated 2 years ago, 26 views

            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="Address"
                android:id="@+id/etmapname"/>

            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="Detailed address"
                android:id="@+id/etadress"/>

            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="Check Location"/>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="300dp"
                android:id="@+id/mapmap"
                android:orientation="vertical"/>

I made an address input window and button in xml like this. If you enter the address and detailed address and press the Lookup button, I want the location to be displayed as a marker on the Naver map below. In Java,

    mMapView = new NMapView(this);
    mMapView.setBuiltInZoomControls(true, null);
    mMapView.setClickable(true);
    mMapView.setApiKey(API_KEY);

    mLinearLayout = (LinearLayout)findViewById(R.id.mapmap);
    mLinearLayout.addView(mMapView);

This is how only the map is printed. How do I write the code to do it like I asked you above? Please.

android

2022-09-22 16:43

1 Answers

If you look at the link below, there is an API that returns the address in coordinates.

The first is to obtain latitude and longitude coordinates after calling the API above using the address entered in the edit text. Then, you can create a marker using latitude and longitude, and then display the marker on the map to implement the desired part.


2022-09-22 16:43

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.