コード例 #1
0
ファイル: OsmRelationLayer.cs プロジェクト: rhinos07/OSMScout
        private void PaintNode(System.Drawing.Graphics g, Node node)
        {
            Coordinate objectCoord = new Coordinate(node.Lat, node.Lon);

            if ((leftBottom.Longitude < objectCoord.Longitude) && (objectCoord.Longitude < rightTop.Longitude)
                && ((leftBottom.Latitude < objectCoord.Latitude) && (objectCoord.Latitude < rightTop.Latitude)))
            {
                Point drawAt = CalculateScreenPos(objectCoord );

                g.FillRectangle(Brushes.Gray, drawAt.X - 2, drawAt.Y - 2, 5, 5);
            }
        }
コード例 #2
0
ファイル: OsmRelationLayer.cs プロジェクト: rhinos07/OSMScout
        private Node GetNode(int id)
        {
            Node node = new Node();
            node.Id = id;

            int index = Array.BinarySearch(osmTree.Nodes, node);

            if (index > 0)
            {
                node = osmTree.Nodes[index];
            }
            else
            {
                node = null;
            }

            return node;
        }
コード例 #3
0
ファイル: OsmRelationLayer.cs プロジェクト: rhinos07/OSMScout
        private void PaintLine(Graphics g, Node firstNode, Node secondNode)
        {
            Coordinate firstObjectCoord  = new Coordinate(firstNode.Lat, firstNode.Lon);
            Coordinate secondObjectCoord = new Coordinate(secondNode.Lat, secondNode.Lon);

            if ((leftBottom.Longitude < firstObjectCoord.Longitude) && (firstObjectCoord.Longitude < rightTop.Longitude)
                && ((leftBottom.Latitude < firstObjectCoord.Latitude) && (firstObjectCoord.Latitude < rightTop.Latitude)))
            {
                Point firstPoint = CalculateScreenPos(firstObjectCoord);
                Point secondPoint = CalculateScreenPos(secondObjectCoord);

                g.DrawLine(wayPen, firstPoint, secondPoint);
            }
        }