Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
osm-locationpicker
Advanced tools
This plugin allows to find and select location on OpenStreetMap map using Google geoode API for address autocomplete and reverse geocoding.
Supports address autocomplete search and location select on map click.
Address autocomplete is using Google Maps Api, Maps displayed via OpenLayers
Plugin saves location information in inputs and provides same data via callbacks.
#jquery #location-picker, #maps, #autocomplete, #geocode, #OpenStreetMap, #OSM, #OpenLayers
See Sample.html demo for configuration and usage
Include required scripts:
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js'></script>
<script src='http://www.openlayers.org/api/OpenLayers.js'></script>
<script src='https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places'></script>
then add location picker plugin reference:
<script src='js/location-picker.js'></script>
Example markup:
<style>
#map { height: 400px; width:100%;}
.map-container { margin-top: 10px;}
</style>
<div class='location-picker'>
<input type='text' id='txtAddress' class='form-control' placeholder='Enter your address here' data-type='address' />
<input type='hidden' id='txtLocation' data-type='location-store' />
<div class='map-container'>
<div id='map' data-type='map'></div>
</div>
</div>
Usage:
<script>
$(function(){
var locationPicker = $('.location-picker').locationPicker({
locationChanged : function(data){
$('#output').text(JSON.stringify(data));
}
});
});
</script>
locationPicker looks for elements with data-type='address', data-type='location-store' and data-type='map' in specified selector by default.
Those elements could be changed via initialization options.
Location selected callback function, initial location information could be passed as well.
All available options are:
<script>
var locationPicker = $('.location-picker').locationPicker({
{
address_el : 'input[data-type="address"]', // address autocomplete input
map_el: '[data-type="map"]', // map element to render OSM map in
save_el: '[data-type="location-store"]', // Location information is stored in this input in JSON format
raw_data: false, /* if true, full place information is returned in JSON format
False by default, returns latitude, longitude and address string in JSON format
*/
init:{
current_location: true, // True by default, initializes location picker with current location
address : 'Put init adddress here',
location : {latitude, longitude} // put initial location here
}
}
// callback method
locationChanged : function(data){
$('#output').text(JSON.stringify(data));
}
});
</script>
Location Picker methods:
FAQs
Open Street Maps location picker with Google Maps API search.
The npm package osm-locationpicker receives a total of 0 weekly downloads. As such, osm-locationpicker popularity was classified as not popular.
We found that osm-locationpicker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.