PHPackages                             net-tools/google-js-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. net-tools/google-js-api

ActiveLibrary[API Development](/categories/api)

net-tools/google-js-api
=======================

Composer library for Google API browser helpers (javascript) ; ECMASCRIPT 5+ required

1.0.6(2y ago)031MITJavaScript

Since Jun 24Pushed 2y ago1 watchersCompare

[ Source](https://github.com/net-tools/google-js-api)[ Packagist](https://packagist.org/packages/net-tools/google-js-api)[ RSS](/packages/net-tools-google-js-api/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (8)Used By (0)

net-tools/google-js-api
=======================

[](#net-toolsgoogle-js-api)

Interface to some Google APIs
-----------------------------

[](#interface-to-some-google-apis)

This packages contains :

- `maps.js` : a helper class `nettools.google.maps.MapManager` to provide useful methods to display maps, routes, and markers.

Setup instructions
------------------

[](#setup-instructions)

To install net-tools/google-js-api package, just require it through composer and insert any script tag required in the `HEAD` section (replace `file.js` with any of the above packages) :

```

```

Reference
---------

[](#reference)

### nettools.google.maps.MapManager class

[](#nettoolsgooglemapsmapmanager-class)

The `MapManager` class makes it possible to display a map, routes and markers in a simpler way. For example, any marker created is stored in the `MapManager` class, so that they could be later removed from the map with a call to `raz()` method.

First, create an object of `nettools.google.maps.MapManager` class ; required constructor parameters are :

- mapdiv : the ID of the DOM element to display the map into or the DOM node,
- centerpoint : a `google.maps.LatLng` object or a litteral object {lat:value, lng:value} with the desired default display coordinates,
- mapOpt : a litteral object with any of `google.maps.Map` available options (such as `mapTypeId`),
- directionsRendererOpt : a litteral object with any of `google.maps.DirectionsRenderer` available options.

```
var mm = new nettools.google.maps.MapManager(
          // mapdiv
          "map_canvas2",

          // centerpoint
          {lat:45.763691, lng:3.119431},

          // mapOpt : options for google.maps.Map
          {
              // default zoom
              zoom: 2,

              // streetview widget off
              streetViewControl : false
          }
      );

```

`MapManager` class provides the following members :

- **map** : property to access the underlying `google.maps.Map` object,
- **raz()** : method to clear the map ; it removes markers, routes and reset default options (such as centerpoint),
- **getDirectionsRenderer()** : method to get the `google.maps.DirectionsRenderer` object ; useful to get info about a computed route,
- **getDirectionsService()** : method to get the `google.maps.DirectionsService` object,
- **getInfoWindow()** : method to get the `google.maps.InfoWindow` object (one per map),
- **createMarkers(Object\[\])** : method to create a lot of markers at a time ; the expected parameter is an array of litteral objects describing the markers (usually `{position:{lat:xxx, lng:xxx}, map:mm.map, title:'Marker here!'}`),
- **createMarker(Object)** : method to create a single marker ; marker parameters are set in the litteral object expected
- **route(point1, point2, options, callback\_ok, callback\_ko)** : method to compute and display a route between two points. Parameters are :
    - the first two parameters set the start and end coordinates (the type expected can be a string, `google.maps.LatLng` objects, litteral objects `{lat, lng}` or `google.maps.Place` objects),
    - a litteral options object to give parameters to `DirectionsService` class (such as directionsTravelMode, etc.)
    - callbacks for successful result or failure (see sample file for detail

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~386 days

Recently: every ~578 days

Total

7

Last Release

965d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2cb0c1d404c8ae72b0a731246130079c2f440d6ea079815ca8c153aa361b1f28?d=identicon)[nettools.ovh](/maintainers/nettools.ovh)

---

Top Contributors

[![net-tools](https://avatars.githubusercontent.com/u/6818724?v=4)](https://github.com/net-tools "net-tools (6 commits)")

### Embed Badge

![Health badge](/badges/net-tools-google-js-api/health.svg)

```
[![Health](https://phpackages.com/badges/net-tools-google-js-api/health.svg)](https://phpackages.com/packages/net-tools-google-js-api)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
