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.
easygooglemaps
Advanced tools
Readme
Simple layer over Google Maps API to create expandable baloons(infoboxes) on the map. See example. We are tired of google maps syntax, infobox and whatever. Simple and straightforward syntax to do common job like this:
$ npm install --save easygooglemaps
var EasyGoogleMaps = require('easygooglemaps');
// run module here
<script type="text/javascript" src="easygooglemaps.js"></script>
<script type="text/javascript" src="RUN_MODULE_HERE.js"></script>
var MyMap = new EasyGoogleMaps(_options_);
// options reference in next section
MyMap.init();
{
// map options
map: {
APIKEY: 'YOUR_GOOGLEMAPS_API_KEY',
container: '.js-map', // DOM element, where to put map
options: {
center: {lat: -34.097, lng: 150.644},
zoom: 8
}
},
// baloon specific options
infobox: {
class: 'awesome-infobox',
template: '#infobox', // html template for baloon
closeButton: '.js-infobox-close',
onlyOneBox: true, // single baloon visible
// baloon relative to marker position
position: {
x: "left",
y: "center"
}
},
// Array of data (markers,baloons,infoboxes,whatever) to put on the map
// Might be added at any time by .add method described below
markers: {
items: [
{
"content": {
// this is {{=baloon.title}} in html template
"title": "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolore, consequatur."
},
"marker": {
"position": {
"lat": -34.397,
"lng": 150.644
},
"icon": {
"default": "img/markerDefault.png",
"active": "img/markerActive.png",
// for retina icon should be 40x60 pixels
"size": {
"x": 20,
"y": 30
},
"centering": {
"x": 10,
"y": 30
}
}
}
}
]
}
}
And also HTML template (doT template engine) for infobox should be specified:
<script type="text/underscorejs" id="infobox">
<div class="baloon">
<button class="baloon__close js-infobox-close"></button>
<div className="baloon__content">
{{=baloon.title}}
</div>
</div>
</script>
MyMap.onload(function() {
// show map with animation, once it is loaded
});
// this method also accepts array of markers
MyMap.add({
"content": {
"title": "Lorem ipsum"
},
"marker": {
"id": 5, // optional, only if you need to show-hide it later
"position": {
"lat": -34.397,
"lng": 152.244
},
"icon": {
"default": "img/markerDefault.png",
"active": "img/markerActive.png", // optional
"size": {
"x": 41,
"y": 58
},
"centering": {
"x": 20,
"y": 58
}
}
}
});
MyMap.show(2); // shows all markers (one or many) with id equal 2
MyMap.hide(2); // same, but hides
Though our script wraps most of the use cases with map and infoboxes. You can still do whatever you want, because you have access to original Google Maps API:
MyMap.realmap; // returns Google Maps map object
npm run build
- Build task that generates both minified and non-minified scripts,npm run watch
- watch changes, build only minified version;Valentin ‘Whats0n’ Dorosh
Yuri akella Artiukh
MIT © Coderiver
FAQs
Simple layer over Google Maps API for creating maps with markers and controlled balloons.
The npm package easygooglemaps receives a total of 16 weekly downloads. As such, easygooglemaps popularity was classified as not popular.
We found that easygooglemaps demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.