Location and maps [closed]

1
Hello, I'm going to work on an application that will have to work with location and maps, basically the user will inform an address and it will appear to him nearby places, so I wanted to know + - the way of the stones for this, I was thinking about using asp.net mvc and EF , I've heard that perhaps it's better to work with MongoDB instead of EF .

I've also been thinking of using Google maps, so locating nearby places would be + - similar to those bank apps that you tell your zip code or the app picks up your location and shows the nearest agencies, so I'll have that I search the bank for the nearest registered places and order them, I thought of having an attribute for latitude and longitude, but how will I get it and how will I know which ones are closest ... there is some specific API for this. p>     

asked by anonymous 03.01.2016 / 16:51

1 answer

4

There is the Maps API that performs latitude and longitude search from from an address provided as a search source.

Example:

<script>
   geocoder = new google.maps.Geocoder();

  function codeAddress() {
    // Aqui a API pega o valor de um endereço fornecido num campo chamado 'endereco' em tela.
    var endereco = document.getElementById("endereco").value;

    geocoder.geocode( { 'address': endereco}, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        // Aqui o resultado é devolvido dentro do canvas do Google Maps.
        map.setCenter(results[0].geometry.location);
        var marker = new google.maps.Marker({
            map: map, 
            position: results[0].geometry.location
        });
      } else {
        alert("Geocode falhou pelo seguinte motivo: " + status);
      }
    });
  }
</script>

If you need to have a latitude and longitude database, a free alternative is the GeoNames database , which has not only for Brazil, but for several countries in the world.

    
03.01.2016 / 20:24