Download the PHP package xddesigners/silverstripe-mapbox without Composer
On this page you can find all versions of the php package xddesigners/silverstripe-mapbox. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download xddesigners/silverstripe-mapbox
More information about xddesigners/silverstripe-mapbox
Files in xddesigners/silverstripe-mapbox
Package silverstripe-mapbox
Short Description Add a mapbox to silverstripe pages
License BSD-3-Clause
Informations about the package silverstripe-mapbox
Silverstripe Mapbox
Add a Mapbox map to your Silverstripe pages.
Instalation
Simply install the moduel by requireing it in you composer.json or by running:
Then add the controller extension to the page you want the map to show and configure the basic properties:
Configuration
The map can be configured and optionally be configured to hold an icon, the sintax follows the leaflet configuration, any option that you can pass there is passable here. All set options will be combined to a json object.
To center the map to a location you need to add the method mapBoxMarkers()
to the model that holds the MapBox extension. This method needs to return an array with at least one location to center the map on. If using multiple markers you can set the config setting fit_bounds_to_markers
to true so all markers will be displayed on the map.
A interface is available for models that use the extension, just add implements UseMapBox
to your class to force the method.
License
Copyright (c) 2016, XD designers All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- The name of Bram de Leeuw may not be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL