Quantcast
Viewing all articles
Browse latest Browse all 2341

New Post: Adding a simple dot or line on the map (using mapwingis)

Hi there,

I just started with MapWinGIS activex control in vb express 2010.

showing google maps or openstreetmaps etc goes well, I use following code:
AxMap1.Projection = MapWinGIS.tkMapProjection.PROJECTION_GOOGLE_MERCATOR
    AxMap1.TileProvider = MapWinGIS.tkTileProvider.GoogleHybrid
    AxMap1.KnownExtents = MapWinGIS.tkKnownExtents.keNetherlands
    AxMap1.Tiles.DoCaching(MapWinGIS.tkCacheType.Both) = True
    AxMap1.Tiles.UseCache(MapWinGIS.tkCacheType.Both) = True
Then I want to add some lines and dots on this map, coming from measurements we did,
I use following code:
Dim DrawingLayerHandle As Integer
    DrawingLayerHandle = Map.NewDrawing(MapWinGIS.tkDrawReferenceList.dlSpatiallyReferencedList)
    Map.DrawCircleEx(DrawingLayerHandle, Longitude, Latitude, 1000000, System.Convert.ToUInt32(RGB(255, 0, 0)), True)
With every longitude and latitude I use, the circle is drawed at coordinages 0;0 ?

I tried other things like loading a KML file with the same result, the kml coordinates are being ignored and the figure is drawed around coordinates 0,0;
Code:
  Dim filename = "c:\klad\maps\example.kml"
  AxMap1.AddLayerFromFilename(filename, tkFileOpenStrategy.fosAutoDetect, True)
  AxMap1.Refresh()
Example kml:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>Paths</name>
<description>Examples of paths. Note that the tessellate tag is by default
  set to 0. If you want to create tessellated lines, they must be authored
  (or edited) directly in KML.</description>
<Style id="yellowLineGreenPoly">
  <LineStyle>
    <color>7f00ffff</color>
    <width>4</width>
  </LineStyle>
  <PolyStyle>
    <color>7f00ff00</color>
  </PolyStyle>
</Style>
<Placemark>
  <name>Absolute Extruded</name>
  <description>Transparent green wall with yellow outlines</description>
  <styleUrl>#yellowLineGreenPoly</styleUrl>
  <LineString>
    <extrude>1</extrude>
    <tessellate>1</tessellate>
    <altitudeMode>absolute</altitudeMode>
    <coordinates> 
        4.8951679,52.3702157
        5.5951679,52.2702157
        6.1951679,52.1702157
        4.8951679,52.3702157
    </coordinates>
  </LineString>
</Placemark>
</Document>
</kml>


Anyone can help?

Thanks!

Viewing all articles
Browse latest Browse all 2341

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>