simple-gmaps
v0.0.0
Published
[demo](http://alileza.github.io/simple-maps/demo/) ### Example ```html <style> #map{ width: 500px; height: 300px; } </style> <div id="map"></div>
Downloads
4
Readme
Simple Maps
Example
<style>
#map{
width: 500px;
height: 300px;
}
</style>
<div id="map"></div>
<script src="../dist/maps.js"></script>
<script>
var start = function(){
// Maps options
var options = {
zoom : 17 // Options
}
// Draw maps on element id #map
var myMap = new Map('map', options),
myMarkers = []
// Create marker on myMap
myMarkers[0] = new Marker({
map: myMap,
position: { lat: -6.2009877,lng: 106.8391089 }
})
// Drop the marker on the map
myMarkers[0].drop()
}
</script>Installation
add this on you head
<meta id="MAPS_API_KEY" content="apikey123">
<meta id="MAPS_API_URL" content="https://maps.googleapis.com/maps/api/js">
<meta id="MAPS_CALLBACK" content="start">- MAPS_API_KEY : you can get from google developer (required)
- MAPS_API_URL : google maps api URL (optional)
- MAPS_CALLBACK : first function that will called, after maps is loaded
Also add this on bottom of body
<script src="../dist/maps.js"></script>Map API
Construct a Map
var myMap = new Map('map', options)Set Center
myMap.setCenter({ lat: -6.2009877,lng: 106.8391089 });Set Zoom
myMap.setZoom(10);Marker API
Create a Marker
var myMarker = new Marker({
map: myMap,
position: { lat: -6.2009877,lng: 106.8391089 }
})Draw Marker to Map
myMarker.draw()Drop
myMarker.drop()Jump
myMarker.jump()Jump Once
myMarker.jumpOnce()Remove
myMarker.remove()