Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simple-gmaps

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-gmaps

[demo](http://alileza.github.io/simple-maps/demo/) ### Example ```html <style> #map{ width: 500px; height: 300px; } </style>

  • 0.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Simple Maps

demo

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()

FAQs

Package last updated on 05 Dec 2015

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc