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

Marker move / set location

Is there any way to either move a marker or drop a new marker on SfMaps?

So what we are looking for is ideally bound updating of marker co-ordinates (when a user drags a marker), or if that's not possible, events that could be picked up on when a marker is moved, so programatically could set data point location. And finally, picking up on a map click to drop a marker, and obtain the corresponding GPS co-ordinates for.

Is any of this possible, or planned? I did see a reference somewhere that this, or something like this was to be in Jan 2019 release, but can't see it. 

Please let us know.
Phil

9 Replies

BK Bharathiraja K Syncfusion Team March 27, 2019 07:01 AM UTC

Hi Phil, 
 
Greetings from Syncfusion. 
 
Please find the response for your queries below here. 
 
Query 1: Events that could be picked up on when a marker is moved. 
 
MarkerSelected event will be fired when selecting the marker. Please refer the following UG document for more information. 
 
 
Query 2: Marker co-ordinates 
 
We have implemented the “Get Latitude and Longitude coordinates of Markers based on point and vice versa” feature and included in our latest Beta version (17.10.32). 
 
Please find the below details for more information about the feature. 
 
SfMaps offers two utility methods to transform the pixel values to longitude and latitude values and vice-versa. This method is used for both ShapeFileLayer and ImageryLayer. 
 
GeopointToViewPoint(double latitude, double longitude) - Converts the latitude and longitude values to screen point. Here, pass the parameters as latitude and longitude values, from that values we can get screen points x and y. 
GetLatLonFromPoint(Point point) - Converts the screen point to longitude and latitude values. Here, pass the parameters as screen points x and y, from that points we can get longitude (Point.X) and latitude (Point.Y) values. 
 
We have prepared the sample. Please find the sample from the following location. 
 
 
Also, we have published our Volume1 Beta release and the feature was included in the new version. Please find below the Volume 1 2019 Beta Release v17.1.0.32 link.  
  
  
Note: Select the Include prerelease checkbox in Package Manager Solution to download our latest Beta version NuGet packages. 
 
Regards, 
Bharathi. 



PH Phil Holmes March 28, 2019 05:11 AM UTC

Thanks Barathi,

That sounds like it would help, but still not get me there. The MarkerSelected event would let me pick up when a pin is selected, but I can't see how that would give me any access to when the marker is then dragged somewhere else, or if the user clicks somewhere on the map to drop a pin. Remember, what I am trying to do here is let the user mark where a pin should go on the map.

I can see that if I did have this, then the Query 2 part of your response would let me convert the pixel coordinates to LatLon co-ordinates.

Am I missing something here, or is there some way to do the "Set Pin Location" function?

Thanks,
Phil


BK Bharathiraja K Syncfusion Team March 29, 2019 12:29 PM UTC

Hi Phil, 
 
Thanks for the patience. 
 
We have achieved your requirement as a workaround sample by using the touch events. We have added the markers in the touch down event. Please find the sample from the following location. 
 
 
Query 2: Convert the pixel coordinates to LatLon co-ordinates. 
 
You have to give a screen point / touch point of the layer in the GetLatLonFromPoint (Point point) method to convert the touch point to corresponding Latitude and Longitude points. 
 
Thanks, 
Bharathi. 



PH Phil Holmes April 1, 2019 06:18 AM UTC

Thanks Barathi,

That code does seem to be doing what I need. I notice you are doing the marker creation in the platform-specific Custom Renderers, so I assume these markers are also then available for programatic access back in the PCL code. I will try adopting this technique & let you know if it proves out all OK.

I understand this functionality is currently in beta release, which I am reluctant to release to our production. Do you have an estimate of when this will go stable release?

Thanks,
Phil


BK Bharathiraja K Syncfusion Team April 1, 2019 06:53 AM UTC

Hi Phil, 
 
Query 1:  I notice you are doing the marker creation in the platform-specific Custom Renderers, so I assume these markers are also then available for programmatic access back in the PCL code 
 
We have used platform-specific Custom Renderers only to get the touch point. After receiving the touch point across the three platform, we will pass this to PCL project and will create Markers in PCL project itself.  
 
Query 2: Do you have an estimate of when this will go stable release? 
 
We are glad to announce that our Essential Studio 2019 Volume 1 release (v17.1.0.38) is rolled out and is available for download under the following link. 
 
 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
 
Regards, 
Bharathi. 



PH Phil Holmes April 5, 2019 07:00 AM UTC

Hi,

Unfortunately I can't proceed with this just yet, as that release (v17.1.0.38) has some issues. Sorry I can't be more specific, but after updating my Syncfusion libraries to this version, my pre-existing, working project is fairly regularly dropping out. And after spending 1.5 days on it so far, difficult to trace the specific problem, as it does seem to be library problems. App works 100% with v16, not v17. 

I will monitor for an update to this, hoping you otherwise find the new problems with v17.1.0.38.

Thanks,
Phil


BK Bharathiraja K Syncfusion Team April 5, 2019 10:23 AM UTC

Hi Phill, 
 
We don’t face any problem with our latest version 17.1.0.38 version from our customer right now. So, if you face any issues, please share the crash log report, replication steps or any other details. We will investigate and provide you solution. 
 
Regards, 
Bharathi. 



RA rameez August 27, 2021 12:27 PM UTC

How can we move the selected marker or set location in MVVM structure-based project



ET Eswaran Thirugnanasambandam Syncfusion Team August 30, 2021 11:16 AM UTC

Hi Rameez, 
 
Greetings from Syncfusion. 
 
Currently we don’t have support to drag or move the marker added on SfMaps. We have already logged a feature request for this requirement “Drag and drop support for markers in SfMaps” and it can be tracked through our feedback portal below.   
    
    
Please cast your vote to make it count. We will prioritize the features every release based on the demands, and we do not have immediate plan to implement this feature since we committed with already planned work. So, this feature will be available any of our upcoming release.    
    
If you have any more specification/suggestions to the feature request, you can add it as a comment in the portal.   
  
Regards, 
Eswaran 


Loader.
Live Chat Icon For mobile
Up arrow icon