Google map with autocomplete

Overview

Nova Google Map With Autocomplete Field Package

This field allows you to work with Google Places API to autocomplete and Google Map on user input and get the full real address with all the metadata (like latitude and longitude).

Installation

You can install the package in to a Laravel app that uses Nova via composer:

composer require trinityrank/google-map-with-autocomplete

Now publish config and localization files:

php artisan vendor:publish --provider="Trinityrank\GoogleMapWithAutocomplete\FieldServiceProvider"

Create an app and enable Places API and create credentials to get your API key https://console.developers.google.com

Add the below to your .env file

GMAPS_API_KEY=############################

Usage

Add the use declaration to your resource and use the fields:

use Trinityrank\GoogleMapWithAutocomplete\TRMap;
use Trinityrank\GoogleMapWithAutocomplete\TRCountry;
use Trinityrank\GoogleMapWithAutocomplete\TRState;
use Trinityrank\GoogleMapWithAutocomplete\TRCity;
use Trinityrank\GoogleMapWithAutocomplete\TRZipCode;
use Trinityrank\GoogleMapWithAutocomplete\TRAddress;

TRMap::make('Map'), // Google Map with address picker
TRCountry::make('Country'), // Country field
TRState::make('State'), // State field
TRCity::make('City'), // City field
TRZipCode::make('Zip Code'), // Zip Code Filed
TRAddress::make('Address'), // Autocomplete address field

Add the use declaration to your resource and use the panel with all fileds:

use Trinityrank\GoogleMapWithAutocomplete\TRLocation;

TRLocation::make('Location'), // All fileds in panel with required rule

Image of character counter

Customize Fields

Add custom latitude, longitude and zoom values for starting point

TRMap::make('Map')
    ->latitude('latitude')
    ->longitude('longitude')
    ->zoom('zoom'),

Hide latitude and longitude field

TRMap::make('Map')
    ->hideLatitude()
    ->hideLongitude(),

You can add any nova basic methods to fileds (Showing / Hiding, Validation ... ).

You might also like...
Lumen on Docker - Skeleton project with Nginx, MySQL & PHP 8 | Aws ECS, Google Kubernates, Azure Container Engine

Docker infrastructure for Lumen Description Microservice Lumen is a starting skeleton based on Docker and Lumen Framework. This project helps to devel

Google Search Results PHP API via Serp Api

Google Search Results in PHP This Php API is meant to scrape and parse Google, Bing or Baidu results using SerpApi. The full documentation is availabl

A collection of samples that demonstrate how to call Google Cloud services from PHP.

PHP Docs Samples A collection of samples that demonstrate how to call Google Cloud services from PHP. See our other Google Cloud Platform github repos

A collection of samples that demonstrate how to call Google Cloud services from PHP.

PHP Docs Samples A collection of samples that demonstrate how to call Google Cloud services from PHP. See our other Google Cloud Platform github repos

Pat if amp - ⚡ A Textpattern Conditional Plugin for Google's Accelerated Mobile Pages Project (AMP)
Pat if amp - ⚡ A Textpattern Conditional Plugin for Google's Accelerated Mobile Pages Project (AMP)

pat_if_amp Download | Packagist AMP pages for Textpattern CMS. This conditional tag examines the URL of the current page and determines if the URL end

This module integrates Silverstripe CMS with Google Translate API and then allows content editors to use automatic translation for every translatable field.
This module integrates Silverstripe CMS with Google Translate API and then allows content editors to use automatic translation for every translatable field.

Autotranslate This module integrates Silverstripe CMS with Google Translate API and then allows content editors to use automatic translation for every

Laravel & Google Drive Storage - Demo project with Laravel 6.x and earlier

Laravel & Google Drive Storage Demo project with Laravel 8.X Look at the commit history to see each of the steps I have taken to set this up. Set up t

Configure Magento 2 to send email using Google App, Gmail, Amazon Simple Email Service (SES), Microsoft Office365 and many other SMTP (Simple Mail Transfer Protocol) servers
Configure Magento 2 to send email using Google App, Gmail, Amazon Simple Email Service (SES), Microsoft Office365 and many other SMTP (Simple Mail Transfer Protocol) servers

Magento 2 SMTP Extension - Gmail, G Suite, Amazon SES, Office 365, Mailgun, SendGrid, Mandrill and other SMTP servers. For Magento 2.0.x, 2.1.x, 2.2.x

Comments
  • Config should cast env to desired type?

    Config should cast env to desired type?

    Setting GMAPS_DEFAULT_ZOOM=3 in .env ends up with a javascript error

    InvalidValueError: setZoom: not a number
    

    Or perhaps when using in the JS it needs to convert it to a number.

    opened by LiamKarlMitchell 0
  • Dragging marker doesn't  update longitude or latitude

    Dragging marker doesn't update longitude or latitude

    When you drag the marker and save the resource, the new position is not saved.

    It shows me this error in the console every time I drag the marker: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'address_components') at Proxy.setPlace (google-map-with-autocomplete:3133:56) at google-map-with-autocomplete:3127:23

    I'm using Laravel 9.37.0 Php 8.1.1 Nova 4.17.1

    opened by tesren 0
  • Nova flexible content incompatibility

    Nova flexible content incompatibility

    Nova Flexible Content stores the field data in a json text field in the DB, and provides the Nova components the data as array instead of objects. This makes the resolve function fail, because it expects model objects.

    This PR fixes the issue: https://github.com/trinity-rank/google-map-with-autocomplete/pull/3

    opened by tothmarkandor99 1
  • Resource resolution from array

    Resource resolution from array

    Fixes https://github.com/trinity-rank/google-map-with-autocomplete/issues/4

    Some packages, like Nova Flexible Content provide the resource to the field as an array, thus getAttribute() calls fail causing an error. This PR fixes the bug by first checking if $resource is an array

    opened by tothmarkandor99 0
Releases(v1.0.0)
Owner
TrinityRank DevTeam
TrinityRank DevTeam
Maps Railroad Online Savegames to a SVG map

RailroadOnlineMapper @ian76g#6577 Environments DEV - https://zwackelmann.online/ QA - https://ohnezahn.online/ PROD - https://minizwerg.online/ Gettin

Sebastian Köhler 5 Jan 3, 2023
PHP library that helps to map any input into a strongly-typed value object structure.

Valinor • PHP object mapper with strong type support Valinor is a PHP library that helps to map any input into a strongly-typed value object structure

Team CuyZ 873 Jan 7, 2023
A plugin to test Server->getPlayerExact() vs Map performance

PeformanceTests A plugin to test Server->getPlayerExact() vs Map<username, Player> performance Timings with Server->getPlayerExact() https://timings.p

KingOfTurkey38 1 Feb 25, 2022
Generate static map url for maptiler.com

PHP static maps url generator The package is used for static maps (images) URL generate. For now, it works only with maptiler.com. I welcome your comm

Andrey Surzhikov 2 Sep 8, 2022
:passport_control: Helper for Google's new noCAPTCHA (reCAPTCHA v2 & v3)

noCAPTCHA (new reCAPTCHA) By ARCANEDEV© What is reCAPTCHA? reCAPTCHA is a free service that protects your site from spam and abuse. It uses advanced r

ARCANEDEV 342 Dec 30, 2022
Adds a header to every response to try and twart Google's usage of your site in it's FLoC tracking method.

Laravel No FLoC This package will add the Permissions-Policy: interest-cohort=() to try and twart Google's usage of your site in it's FLoC tracking me

Jean-Philippe Murray 11 Jul 14, 2022
Get mobile app version and other related data from Google Play Store, Apple App Store and Huawei AppGallery

Mobile App Version Get mobile app version and other related data from Google Play Store, Apple App Store and Huawei AppGallery. Installation Add to co

Omer Salaj 11 Mar 15, 2022
Connect Nios4 with Google Calendar via PHP

Nios4_Google_Calendar Connect Nios4 with Google Calendar via PHP ISTRUZIONI INTEGRAZIONE GOOGLE CALENDAR CON NIOS4. Guida per l'integrazione del calen

null 2 Sep 23, 2021
Google-like values converter

Google-like values converter. Support for different types of conversions, for examples: 1 kilometer -> meters 1 dollar -> THB 1 kilogram -> meters ...

Pavinthan 1 Nov 4, 2021
Swap Google Fonts Display

Swap Google Fonts Display

FlyingWeb Solutions 2 May 17, 2022