We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

how to get logtitude and lattitude with keywords

I am working on the maps in angular7. I want to know how to get longtitude and latitude  from the keywords. 
functionlity: I have an entry field for address. By using specific keywords from that field i want to get  longtitude and latitude and display the "OpenStreetMap" with marker. Also I should able to change marker and get the address.
Thanks in advance

5 Replies

AR Arun Raji Syncfusion Team October 8, 2019 10:58 AM UTC

Hi Annmaria, 
Greetings from Syncfusion. 
We have validated your scenario. As of now you can specify the latitude and longitude to the data source property of marker settings as depicted below. 
Code Snippet 
markerSettings: [ 
        visible: true, 
        dataSource: [ 
                name: 'Marker1', 
                latitude: 40.7488758, 
                longitude: -73.9730091 
                name: 'Marker2', 
                latitude: 40.8488758, 
                longitude: -73.9530091 
        animationDuration: 0, 
        shape: 'Circle', 
        tooltipSettings: { 
            visible: true, 
            valuePath: 'name' 
But we suspect that your requirement is to map the latitude and longitude fields from your data source. If this is your exact requirement could you, please confirm on this? So, that we can proceed further to provide you the solution sooner. 
Also, if you need to get a latitude and latitude values manually, you can use click event args. In click event you can get the coordinates values of map, where you clicked. Given a sample link below for your reference. 
Find the documentation link below for marker on maps. 

Let us know if you have any concern. 

AC Annmaria Cherian October 8, 2019 11:22 AM UTC

Hi Arun,

Thanks for the replay.
My concern is after the user enters the keywords of the address, a marker should come on the address. For example if user enters a value deira,Dubai,UAE then we want to show marker on the particular address. I think if I am getting longtitude and lattitude of the place then its easy for showing marker. Please help me for the solution and thanks for the information it is very useful for me.

AR Arun Raji Syncfusion Team October 9, 2019 08:34 AM UTC

Hi Annmaria, 
Thanks for your revert.  
We have validated your query. But using the keyword, we could not get the latitude and longitude values in the maps controls. For this scenario, you have to store the latitude and longitude values of a country or state or address to a keyword. Then in the sample level, from these names we can get the coordinates values and render the marker in desired position. 
For your reference, according to the above discussion, we have prepared a simple sample with coordinates values for four countries in the dropdown list, which is having that corresponding country names. While we changing the country in dropdown list, it will return the latitude and longitude values to the marker dataSource. Attached the prepared sample in the below location. 
Please let us know if you have any other concern. 

AH Ahmed Hussain October 13, 2019 07:14 AM UTC

Hi Arun,

Thanks for your help. I want to know one more thing, from the latitude and logtitude is it possible to find the address? By using dynamic marker i am getting longtitude and latitude so from these values is it possible to find the location?
Thanks in advance

BP Baby Palanidurai Syncfusion Team October 14, 2019 12:03 PM UTC

Hi Ahmed, 

Thanks for your update. 

We have analyzed your query. There is no built-in support to get locations from the dynamic latitude and longitude. But you can store the locations in the data source and get in the events.  

Kindly revert us, if you have any other concerns. 


Live Chat Icon For mobile
Up arrow icon