Other Software and Data

 View Only
Expand all | Collapse all

Hi Team, I am using the Location Intelligence APIs to achieve my project requirements. I am aware of using geomap api to render a map, but I am not aware of how to get drop a pin and get latitude and longitude to use the geoenrich apis.

  • 1.  Hi Team, I am using the Location Intelligence APIs to achieve my project requirements. I am aware of using geomap api to render a map, but I am not aware of how to get drop a pin and get latitude and longitude to use the geoenrich apis.

    Posted 07-09-2018 19:58

    Hi Team,

    I have been using API - https://api.pitneybowes.com/location-intelligence/geomap/v1/tile/osm/12/1206/1539.png?api_key=<Your API Key>&theme=bronze for rendering the map and

    I know the API - https://api.pitneybowes.com/location-intelligence/geoenrich/v1/address/bylocation?latitude=35.0118&longitude=-81.9571&searchRadius=2640&searchRadiusUnit=feet for getting the address from latitude and longitude.

    But I am missing the API or way to get the latitude and longitude from the Map rendered by GeoMap when user click on the particular location on the map.

    Can you please help for the same?

    Thanks, Neel



  • 2.  RE: Hi Team, I am using the Location Intelligence APIs to achieve my project requirements. I am aware of using geomap api to render a map, but I am not aware of how to get drop a pin and get latitude and longitude to use the geoenrich apis.

    Employee
    Posted 07-09-2018 16:08

    Here is JavaScript sample to use GeoMap with Leaflet JavaScript library.

    http://locate.pitneybowes.com/docs/location-intelligence/v1/en/index.html#GeoMap/Code%20Samples/code_sample_javascript.html

     

    You can use below snipped to get a lat/lon when user clicks on the map.

    map.on('click', function(e){

    var coord = e.latlng;

    var lat = coord.lat;

    var lng = coord.lng;

    console.log("You clicked the map at latitude: " + lat + " and longitude: " + lng);

    });