npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ngx-google-map-helper

v2.0.1

Published

An angular package for using drawing control options of Google Map API

Downloads

68

Readme

Google Map Drawing Controls for Angular (NgxGoogleMapHelper)

Build Status NpmVersion Downloads Fork

Version 2 supports Angular 12

An angular package for using drawing control options of Google Map API. It provides following features,

  • Google Map API Drawing Controls (Marker, Rectangle, Polyline, Polygon, Circle)
  • Custom Buttons (Save, Undo, Delete...)
  • Output Events (OverlayCompleted, MapClicked..)

You can check it online through here NGXGoogleMapHelperDemo

Installation

Install using npm,

$ npm install ngx-google-map-helper --save

Usage

Import

Add NgxGoogleMapHelperModule to your module file:

imports: [
    ... , //your modules
    NgxGoogleMapHelperModule.forRoot({
      apiKey: 'XXXXXXXXXXXXXXXXXXXXXX'
    })
  ]

Example

Refer to main app in this repository for working example. Or this Stackblitz Demo (Please change the API Key with your key in app.module , If the map is not loaded please try - Open In New Window option.)

After importing NgxGoogleMapHelperModule in your module file just use the ngx-google-map-helper component as below,


<ngx-google-map-helper 
    [locationAccess] = true 
    [showControl] = true 
    [mapHeight] = "'1000px'" 
    [mapWidth] = "'50%'"> </ngx-google-map-helper>

Options

You can go through Google Map API here. Google Map Javscript API

| Option | Type | Description | Values | Default | |--------------------|---------------|-------------------------------------------------------------------------------------|------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------| | mapHeight | string | Sets the height of the map | '100px','100%'... | '500px' | | mapWidth | string | Sets the width of the map | '100px','100%'... | '100%' | | zoom | int | Sets the zoom of map | any number | 10 | | center | LatLang | Sets the center of map | object of LatLang | {lat: -34.397, lng: 150.644} | | mapType | string | Sets the type of map | ['ROADMAP', 'SATELLITE', 'HYBRID', 'TERRAIN'] | 'ROADMAP' | | showErrors | boolean | Shows custom error messages on console | true,false | true | | locationAccess | boolean | Allow to get the location of the user | true,false | true | | placeMarkerOnClick | boolean | Places a marker on map in every click | true,false | false | | showControl | boolean | Shows google map drawing controls | true,false | true | | position | string | Sets the location of drawing tools.Refer drawing tools positions of Google Map API. | 'TOP_CENTER' , 'TOP_RIGHT' , 'BOTTOM_LEFT',... | 'TOP_CENTER' | | showModes | string[] | Shows only specified drawing controls. When null shows all. | 'marker' , 'circle' , 'polygon' , 'polyline' , 'rectangle' | All | | commonOption | OverLayOption | Sets the properties of all drawing options. | object of OverLayOption | {fillColor:'#005696' ,fillOpacity:0.2, strokeColor:'#005696' ,strokeWeight:3, clickable:true, editable:true, draggable:true,zIndex:1} | | circleOption | OverLayOption | Overrides only the circle overlay properties. | object of OverLayOption | same as common option default | | polygonOption | OverLayOption | Overrides only the polygon overlay properties. | object of OverLayOption | same as common option default | | polylineOption | OverLayOption | Overrides only the polyline overlay properties. | object of OverLayOption | same as common option default | | rectangleOption | OverLayOption | Overrides only the rectangle overlay properties. | object of OverLayOption | same as common option default | | markerOption | MarkerOption | Overrides only the marker properties. | object of MarkerOption | {animation: 'DROP',draggable: true,title: '',icon: null} | | customButtons | boolean | Shows custom buttons - Undo,Save,Clear ... | true,false | true | | onlyCustomButtons | string[] | Shows only the specified custom buttons.By default shows all. | 'undo','clear','delete', 'save','saveAll' | All | | googleMapObjects | boolean | If true, returns google map objects rather than custom objects. | true,false | false | | shapes | Shape[] | Pass overlays as a shape object to show the overlay on map | Shape objects | [] |

Events

Please note that this events return shape objects only when googleMapObjects = true (by default true), if its false it will return google map event.

| Event | Description | Output | |------------------|-----------------------------------------------------|------------------------| | mapClicked | Event fires when user click on the map. | LatLng Object | | overlayCompleted | Event fires as soon as overlay drawing is finished. | Shape Object | | overlaySelected | Event fires when an overlay is selected | Shape Object | | saveSeleted | Event fires when save custom button is clicked. | Shape Object | | saveAll | Event fires when saveAll custom button is clicked. | Array of Shape Objects |

Versions

| Version | Angular Version | |------------------|-----------------------------------------------------| | V 1.* | Angular 7 | | V 2.* | Angular 12|

Development

Want to contribute?

  • Fork repository.
  • Update ./projects/ngx-google-map-helper
  • Build & Test the library.
  • Update ./src/app with new functionality.
  • Update README.md accordingly.
  • Pull request.
Instructions
  • Download or clone the repository.
  • Install dependencies $ npm install
  • Start the app $ npm start
  • Build the app $ npm run build or $ ng build
  • Build the library after change run either $ npm run package or $ ng build NgxGoogleMapHelper

verify app is working after $ npm start ,

http://localhost:4200

License

MIT Free Software