GithubHelp home page GithubHelp logo

lunarcon / iplocntest Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 7.82 MB

Get decently featured maps in winforms without using the actual API

Visual Basic .NET 100.00%
vb workaround mapping bing-maps geolocation url-manipulation

iplocntest's Introduction

ipLocnTest

Get decently featured maps in .NET, without any actual mapping API involved in your end!

  • Supports Satellite view (with and without labels) and Regular view (with labels).
  • Default Draggable (Through left mouse button) and Zoomable (Through Scroll Wheel), But also provides static mode (higher resolution) (with buttons for zoom, etc)
  • Navigates to given coordinates and name of city/ country.
  • Supports Geolocation (PS: sometimes it doesn't work on the first try)(also your location should be on)
  • Saves image directly to your desktop

Latest Additions

  • ๐Ÿ†• Redesigned toolbar.
  • ๐Ÿ†• Redesigned map options menu.


  • ๐Ÿ†• Now you can search for cities AND countries, along with the regular coordinate search!


  • Added circular Navigation controls for static map. ๐Ÿ†• Now they are dark.


  • Improved zoom in static map.
  • Added Navigation hints to toolbar.
  • Minor design change.
  • Added search tip.

Geolocation - example

Imports System.Device.Location

Put following code inside main class

DIm n = 0
Private Sub Watcher_StatusChanged(ByVal sender As Object, ByVal e As GeoPositionStatusChangedEventArgs)
    n += 1
    If e.Status = GeoPositionStatus.Ready Then
        If Watcher.Position.Location.IsUnknown Then
            txtlat = "Cannot find location data"
        Else
            txtlat = Watcher.Position.Location.Latitude.ToString() '.Substring(0, 7)
            txtlong = Watcher.Position.Location.Longitude.ToString() '.Substring(0, 7)
        End If
    End If
    If n < 10 Then
        If txtlat <> "Cannot find location data" And Math.Abs(Val(txtlat)) > 0.0000001 Then
            Watcher.Stop()
            'the value of txtlat and txtlong has now been set to your location
        End If
    Else
            Watcher.Stop()
           'give user some indication of error/ handle the error (thrown when cannot find location)
    End If
End Sub
Private Sub LocateMe()
    n = 0
    Watcher = New GeoCoordinateWatcher()
    AddHandler Watcher.StatusChanged, AddressOf Watcher_StatusChanged
    Watcher.Start()
End Sub

Call the LocateMe() sub when you require the location. For first use, a messagebox will pop up asking for permission to access location. The values of txtlat and txtlong will be set to the latitude and longitude.

Note that this is usually not instantaneous, and may fail on the first try

iplocntest's People

Contributors

dependabot[bot] avatar lunarcon avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.