Download the PHP package sylvainjule/mapnotator without Composer

On this page you can find all versions of the php package sylvainjule/mapnotator. 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 mapnotator

Kirby Mapnotator

Annotate maps and generate GeoJSON in Kirby by drawing markers, paths and shapes.

screenshot

Overview

This plugin is completely free and published under the MIT license. However, if you are using it in a commercial project and want to help me keep up with maintenance, please consider making a donation of your choice through GitHub Sponsors or Paypal or purchasing your license(s) through my affiliate link.


1. Installation

Download and copy this repository to

Alternatively, you can install it with composer:


2. Setup

Out of the box, the field is set to use open-source services both for geocoding (Nominatim) and tiles-rendering (Positron), without any API-key requirements.

Keep in mind that these services are bound by strict usage policies, always double-check if your usage is compatible. Otherwise, please set-up the field to use Mapbox, see details below.


3. Tile-servers

3.1. Open-source / free tiles

tiles-opensource-2

You can pick one of the 4 free tile servers included:

  1. wikimedia (Terms of Use) → Public usage is now forbidden
  2. openstreetmap (Terms of Use)
  3. positron (default, Terms of Use [Under Free Basemaps Terms of Service])
  4. voyager (Terms of Use [Under Free Basemaps Terms of Service])

You can also set this globally in your installation's main config.php, then you won't have to configure it in every blueprint:

3.2. Mapbox tiles

tiles-mapbox-2

  1. mapbox.outdoorsmapbox/outdoors-v11 (default mapbox theme)
  2. mapbox.streetsmapbox/streets-v11
  3. mapbox.lightmapbox/light-v10
  4. mapbox.darkmapbox/dark-v10

In case your usage doesn't fall into the above policies (or if you don't want to rely on those services), you can set-up the field to use Mapbox' tiles.

You will have to set both the id of the tiles you want to use and your mapbox public key in your installation's main config.php:

You can now explicitely state in your blueprint that you want to use Mapbox tiles:

You can also set this globally in your installation's main config.php, then you won't have to configure it in every blueprint:


4. Geocoding services

4.1. Open-source API (Nominatim)

This is the default geocoding service. It doesn't require any additional configuration, but please double-check if your needs fit the Nominatim Usage Policy.

4.2. Mapbox API

In case your usage doesn't fall into the above policy (or if you don't want to use Nominatim), you can set-up the field to use Mapbox API.

If you haven't already, you will have to set your mapbox public key in your installation's main config.php:

You can now explicitely state in your blueprint that you want to use Mapbox as a geocoding service:

With Mapbox API comes the ability to autocomplete your search. It is activated by default, you can deactivate it by setting the autocomplete option to false.

You can also set this globally in your installation's main config.php, then you won't have to configure it in every blueprint:


5. Per-field options

5.1. center

The coordinates of the center of the map, if the field has no stored value. Default is {lat: 48.864716, lon: 2.349014} (Paris, FR).

Once the field has at least one shape drawn, it will automatically find its initial center in order to display all the shapes.

5.2. zoom

The min, default and max zoom values, where default will be the one used on every first-load of the map. Default is: {min: 2, default: 12, max: 18}.

Once the field has at least one shape drawn, it will automatically find its initial zoom level in order to display all the shapes.

5.3. shapes

The shapes your editors are allowed to draw on the map. They are all activated by default:

5.4. tools

The tools / shape modifiers your editors are allowed ot use. They are all activated by default:

5.5. size

The height of the field. Default is full, which will make the field fill the entire height of the viewport. Options are:

5.6. color

You can change the shapes / markers color by setting this option to any valid color value. Default it blue (#2281f7).


6. Global options

The same options are available globally, which means you can set them all in your installation's config.php file and don't worry about setting it up individually afterwards:


7. Front-end usage

The GeoJSON is stored as YAML and therefore needs to be decoded with the yaml method.

You can then encode it to JSON using Kirby's toolkit:

7.1. circle and circleMarker

The GeoJSON syntax doesn't support circles or circleMarkers. They are stored as a point by default (see this Medium post for more details).

Therefore, the field stores additionnal properties alongside their coordinates, to allow you to recreate them in your projects:

When importing the GeoJSON into your project, you will need to check for those properties in order to transform them into the appropriate shapes. With Leaflet, for example, it would look like:


8. Credits

Services:


9. License

MIT


All versions of mapnotator with dependencies

PHP Build Version
Package Version
Requires getkirby/composer-installer Version ^1.1
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 sylvainjule/mapnotator contains the following files

Loading the files please wait ....