Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
osm-locationpicker
Advanced tools
Readme
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.