ThinkGeo.com    |     Documentation    |     Premium Support

Snapping to Street using the OsmWorldMapKitLayer

 We have built our vehicle location software using WinForms and the OsmWorldMapKitLayer project.  I want to add a Snap To Street feature so the tracked vehicles are on the roads.  I’ve seen the one example out there doing it with a simple layer.  How would I approach this using the OsmWorldMapKitLayer?

Hi Dave, 
  
 Could you please let me know which sample you seen about snap to street feature, so I can help you to see whether that can work for OSM. 
  
 In fact I think that’s not related with what’s the base layer you are using. Because it looks you want to track vehicles, so that’s should only related with the vehicle feature but not the base map. You can view the “Vehicle Tracking” project in our Produce Center, you can find it like this: 
  
 Map Suite Desktop Edition -> Project Templates-> Vehicle Tracking 
  
 Wish that’s helpful. 
  
 Regards, 
  
 Don

The sample I found in the wiki was at this location. 
 wiki.thinkgeo.com/wiki/Source_Code_ServicesEditionSample_SnapGpsToStreet_CS_100108.zip 
  
 It was linked from this location and was called “Snap GPS to Street” 
 wiki.thinkgeo.com/wiki/Map_Suite_Desktop_Edition_Vehicle_Tracking_Samples 
  
 I’ll take a look at the Project Template Tracking sample.

Hi Dave, 
  
 Thanks to let me know the sample, I view its code and found it need to "Query" in featureLayer, so it can only be based on your local feature file. But OSM layer only provided tile images, so you cannot do any query for it. 
  
 So I think you cannot implement that for OSM layer follow this sample. 
  
 Regards, 
  
 Don

Hi Don,  
  
 I downloaded the MapSuiteVehicleTracking_Desktop demo as mentioned in your earlier post.  This is a nice demo. It shows a great example of vehicle tracking however I do not see any snapping occurring in the code.

Hi Dave, 
  
 I am sorry that don’t works for your scenario. 
  
 But just like my previous reply, it looks your base layer is OSM, but we don’t have any OSM feature can be snap, so I think the solution should be download OSM shape data to local then render it and try to snap it. 
  
 Regards, 
  
 Don