Download the PHP package imamhsn195/interactive-map without Composer

On this page you can find all versions of the php package imamhsn195/interactive-map. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package interactive-map

Laravel Interactive Map

A Laravel package for interactive maps using Leaflet.js. This package provides an easy-to-use Blade component and helper functions to display interactive maps with multiple location markers.

Features

Installation

Via Composer

For Local Development/Testing

If you want to test the package locally before publishing, see TESTING_LOCALLY.md for detailed instructions.

For publishing instructions, see PUBLISHING.md.

Quick setup:

  1. Add path repository to your Laravel project's composer.json:

    Note: symlink: true enables auto-sync - changes in the package are immediately reflected without running composer update. See LOCAL_SETUP.md for details.

  2. Install: composer require imamhsn195/laravel-interactive-map:@dev
  3. Publish assets: php artisan vendor:publish --tag=interactive-map-assets

Step 1: Install Package

Step 2: Publish Assets (Optional)

If you want to customize the configuration, views, or assets:

Usage

Important: Layout Requirements

The map component uses Laravel's @push directive to add styles and scripts. Make sure your Blade layout file includes the corresponding @stack directives:

In your layout file (e.g., resources/views/layouts/app.blade.php):

Without these @stack directives, the map styles and JavaScript won't load, causing the map to not display properly.

Custom Stack Names:

If your layout uses different stack names (e.g., @stack('css') and @stack('js')), you can configure them in config/interactive-map.php:

Method 1: Using Blade Component (Recommended)

The easiest way to use the map is with the Blade component:

Method 2: Using Helper Function

Method 3: Using in Controller

Then in your Blade template:

Method 4: Using with Database Model

Location Data Format

Each location can have the following fields:

Field Required Description Alternative Names
name Yes Location name title
lat Yes Latitude latitude
lng Yes Longitude longitude
url No Google Maps URL map_url
address No Physical address -
description No Additional description -

Configuration

After publishing the configuration file, you can customize the map settings in config/interactive-map.php:

Configuration Options

Option Default Description
tile_layer OpenStreetMap URL Map tile provider
attribution OSM attribution Map attribution text
zoom 8 Default zoom level
padding [50, 50] Bounds padding
marker_click_zoom 11 Zoom level on marker click
container.id 'mapContainer' Container element ID
container.height '400px' Default map height
container.width '100%' Default map width
stacks.styles 'styles' Blade stack name for styles
stacks.scripts 'scripts' Blade stack name for scripts

Component Attributes

When using the Blade component, you can pass the following attributes:

Requirements

Browser Support

This package uses Leaflet.js, which supports all modern browsers:

Customization

Custom Styling

After publishing assets, you can customize the CSS in public/vendor/interactive-map/css/interactive-map.css.

Custom Views

After publishing views, you can customize the Blade template in resources/views/vendor/interactive-map/map.blade.php.

Troubleshooting

Map not displaying

  1. Check your layout file - Ensure you have @stack('styles') in <head> and @stack('scripts') before </body> in your Blade layout file. Without these, the map styles and JavaScript won't load.
  2. Ensure Leaflet.js is loading correctly (check browser console)
  3. Verify the container ID is unique on the page
  4. Check that the container has a defined height

Markers not showing

  1. Verify location coordinates are valid (lat/lng)
  2. Check that locations array is not empty
  3. Ensure coordinates are within valid range (-90 to 90 for lat, -180 to 180 for lng)

Styles not applying

  1. Verify @stack('styles') is in your layout - The component uses @push('styles') which requires @stack('styles') in your layout
  2. Publish assets: php artisan vendor:publish --tag=interactive-map-assets
  3. Clear view cache: php artisan view:clear
  4. Check that CSS file is being loaded in browser DevTools

JavaScript not working

  1. Verify @stack('scripts') is in your layout - The component uses @push('scripts') which requires @stack('scripts') in your layout
  2. Check browser console for JavaScript errors
  3. Ensure Leaflet.js library is loading (check Network tab)

License

MIT License

Support

For issues, questions, or contributions, please visit the GitHub repository.

Changelog

See CHANGELOG.md for version history.


All versions of interactive-map with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
illuminate/view Version ^9.0|^10.0|^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package imamhsn195/interactive-map contains the following files

Loading the files please wait ...