ThinkGeo.com    |     Blog    |     Wiki    |     Support

OpenStreet Maps and WGS84 map

Recently, I downloaded MapSuite 10 free licence. For many years we used as a company MapSuite 2, and we have decided to try the new edition. We develop a Winforms application for tracking vehicles. I have begun to adapt our old code from MapSuite 2 to the new edition and I have a few questions. I load a WGS84 map from shape files and an OpenStreet map. In my app, I have a toggle button which allows the user to switch between the two maps. When the user switch from one map to another I want the map to have the same zoom level and show the same place, our main map have GeogrphyUnit= DecimalDegree and OpenStreetMaps use Meter. My other question is how can I load Openstreet maps as background and load shape files (.shp WGS84) above them, and show them both.

Hi Mario,

The solution is set map unit equal meter.

And assign projection to the shape file layer convert it from epsg 4326(WGS 84) to 3857.

The code should looks like:

             Proj4Projection proj4 = new Proj4Projection(4326, 3857);
            ShapeFileFeatureLayer layer = new ShapeFileFeatureLayer("Your Shape File");
            layer.FeatureSource.Projection = proj4;

Our V10 API should be different than V2, you can learn more about them in our wiki.thinkgeo.com, or you can view our sample in https://github.com/thinkgeo

Wish that’s helpful.

Regards,

Ethan

Hi Mario,

Please directly reply us here:

  1. I noticed you hadn’t mentioned which edition you are using, because the detail implement is not the same for all edition, so I hadn’t built a sample for you. Please let us know what version you are using.

  2. About vehicle we have a group sample about it, you can view them and wish that’s helpful: https://github.com/ThinkGeo?utf8=✓&q=vehicle&type=&language=

  3. About the map disappear when mousedown and appear when mouseup, that’s related with your detail code, I think we can try to reproduce it after make sure your version.

  4. Choose marker and image is decided by your scenario, your feature number and your edition choosen.

Wish that’s helpful.

Regards,

Ethan

  1. We are using MapSuite 10
    2.I already have downloaded this sample, but I have a problem with OleDB and I cannot see the vehicles.
    3.The map does not disappear, the markers and their images disappear.

It is important for our application to use tooltip and context menu. This is the reason I used marker. Is there any other way except using markers?

Hi Mario,

  1. I means Web Edition, Desktop Editon or WPF Edition, I checked your order, it looks you are using DesktopEdition.

  2. The sample should based on MapSuite 10.2, now our version should be 10.3, you should want to update the package to latest version. If your OleDB have problem, I think you can solve it by install Microsoft package or install Office to solve it. And you can also modify the code, build virtual vehicle instead of read it from MDB file, The function should be GetCurrentVehicle.

  3. I build a very simple sample, please view it, wish it’s helpful.9315.zip (103.8 KB)

Regards,

Ethan

In this sample that you sent me, the vehicle (marker) disappears with mousedown and move. Is there a way not to disappear? Our application is about tracking vehicles, so the vehicles must not disappear from the map. I have tried to show vehicles as pointshapes with feature, but pointshapes does not support tooltip or context menu. Moreover when I rapidly zoom in and zoom out, the image of the marker does not load properly (for a brief moment) as you can see in the image. When the map has more layers and become slower the image will remain cropped for more time, and this must not happens.

Hi Mario,

The marker will disappear and appear again when pan, it’s the same for SimpleMakerOverlay and InmemoryMarkerOverlay, so here I find a workaround for you.

Put the feature into InmemoryFeatureLayer, and write a custom tooltip for it.

9315(CustomToolTip).zip (103.4 KB)

You can optimize or enhancement the code to make it works better for your scenario.

Regards,

Ethan