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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Blazor Map Markers using complex / nested lists

Thread ID:

Created:

Updated:

Platform:

Replies:

149168 Nov 17,2019 12:10 AM UTC Nov 20,2019 01:36 PM UTC Blazor 4
loading
Tags: Maps
Sorin
Asked On November 17, 2019 12:10 AM UTC

Hello, I'm working with the Blazor Maps, specifically going off of the examples given in https://ej2.syncfusion.com/blazor/documentation/maps/markers/

I'm curious if there is a way to plot the markers by using a list of points where the Latitude/Longitude are within more complex structures.
For a simple example, given the following definition:

 public class GPS
    {
        public double Latitude;
        public double Longitude;
    }

    public class City2
    {
        public GPS gpslocation;
        public string Name;
    };

    private List<City2> cities2 = new List<City2> {
        new City2 { gpslocation = new GPS { Latitude = 35.145083, Longitude = -117.960260 }, Name= "California"}
    };

If I try calling <MapsMarker Visible="true" DataSource="@cities2"> </MapsMarker> , then the marker will not display.
Is there a way to tell the Map where within the structure to find the latitude and longitude, similar to how the XName and YName parameters can be set on the EjsChart?

Thanks,
Sorin 


Attachment: Map_Test_8061afaa.zip

Sorin
Replied On November 17, 2019 12:13 AM UTC

I found one possible workaround being the following:
<MapsMarker Visible="true" DataSource="@cities2.Select(e => e.gpslocation).ToList()"> </MapsMarker> 

But I'm still wondering if there is a way to explicitly define the latitude and longitude parameters within the "DataSource" element.

Thanks,
Sorin

Baby Palanidurai [Syncfusion]
Replied On November 18, 2019 10:10 AM UTC

Hi Sorin, 

Thanks for your update. 

We have analyzed your query. As of now, we need to define latitude and longitude parameters within the data source to render the marker for maps. If we define other than those parameters within the data source, then the markers will not render. So, we need to use latitude and longitude parameters within the data source.  

As of now, there are no explicitly binding attributes for latitude and longitude from the data source to render markers. And also, there is no support to access complex input data for marker data sources like our charts. Kindly use your workaround solution to access the values from complex inputs for the marker data sources. 

Kindly revert us, if you have any concerns. 

Regards, 
Baby. 


Sorin
Replied On November 19, 2019 01:14 PM UTC

Hello Baby,

Thank you for your feedback. 
It's no problem for me for now to use the workaround.
Would it be possible to put this functionality as a low priority feature request to the development team?

Thanks,
Sorin

Baby Palanidurai [Syncfusion]
Replied On November 20, 2019 01:36 PM UTC

Hi Sorin, 

Thanks for your update. 

We have considered your request as new feature request and logged a feedback for this. It can find from the below link. 


Please cast your vote to make it count. We will prioritize the features of every release based on the demands.   
If you have any more specification/suggestions to the feature request, you can add it as a comment in the portal.   

Regards, 
Baby. 



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon