2017 © Pedro Peláez
 

yii2-extension yii2-leaflet-draw-plugin

Plugin for the 2amigo Leaflet extension that adds the Leaflet.Draw functionality.

image

davidjeddy/yii2-leaflet-draw-plugin

Plugin for the 2amigo Leaflet extension that adds the Leaflet.Draw functionality.

  • Friday, September 25, 2015
  • by davidjeddy
  • Repository
  • 0 Watchers
  • 0 Stars
  • 143 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 7 % Grown

The README.md

Leaflet Draw Plugin

Yii 2 LeafletJs Plugin for the 2amigo Leaflet extension that adds the Leaflet Draw functionality., (*1)

This Plugin works in conjunction with LeafLet library for Yii 2 framework., (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Either run, (*4)

php composer.phar require "davidjeddy/yii2-leaflet-draw-plugin" "*"

or add, (*5)

"davidjeddy/yii2-leaflet-draw-plugin" : "*"

to the require section of your application's composer.json file., (*6)

Usage

    // first lets setup the center of our map
    $center = new \dosamigos\leaflet\types\LatLng(['lat' => 51.508, 'lng' => -0.11]);

    // now lets create a marker that we are going to place on our map
    $marker = new \dosamigos\leaflet\layers\Marker(['latLng' => $center, 'popupContent' => 'Hi!']);

    // The Tile Layer (very important)
    $tileLayer = new \dosamigos\leaflet\layers\TileLayer([
       'urlTemplate' => 'http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpeg',
        'clientOptions' => [
            'attribution' => 'Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="http://developer.mapquest.com/content/osm/mq_logo.png">, Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
            'subdomains'  => '1234',
        ]
    ]);

    // now our component and we are going to configure it
    $leaflet = new \dosamigos\leaflet\LeafLet([
        'center' => $center, // set the center
    ]);

    // init the 2amigos leaflet plugin provided by the package
    $drawFeature = new \davidjeddy\leaflet\plugins\draw\Draw();
    // optional config array for leadlet.draw
    $drawFeature->options = [
        "position" => "topright",
        "draw" => [
            "polyline" => [
                "shapeOptions" => [
                    "color" => "#ff0000",
                    "weight" => 10
                ]
            ],
            "polygon" => [
                "allowIntersection" => false, // Restricts shapes to simple polygons
                "drawError" => [
                    "color" => "#e1e100", // Color the shape will turn when intersects
                    "message" => "<b>Oh snap!</b> you can't draw that!" // Message that will show when intersect
                ],
                "shapeOptions" => [
                    "color" => "#bada55"
                ]
            ],
            "circle" => true, // Turns off this drawing tool
            "rectangle" => [
                "shapeOptions" => [
                    "clickable" => false
                ]
            ]
        ]
    ];

    // Different layers can be added to our map using the `addLayer` function.
    $leaflet->addLayer($marker)             // add the marker
            ->addLayer($tileLayer)          // add the tile layer
            ->installPlugin($drawFeature);  // add draw plugin

    // we could also do
    echo $leaflet->widget(['options' => ['style' => 'min-height: 300px']]);

Testing

TODO

Todo

ADD edit menu ability ADD custom marker functionality, (*7)

Contributing

Please see ./docs/CONTRIBUTING for details., (*8)

Credits

License

The BSD License (BSD). Please see ./docs/License File for more information., (*9)

Special Thanks

2amigOS!
Web development has never been so fun!
http://2amigos.us/, (*10)


Sourcetoad is an award winning app development firm based in Tampa, FL. We are specialists in cross-platform web and mobile application development.
http://sourcetoad.com/, (*11)

The Versions

25/09 2015

dev-master

9999999-dev

Plugin for the 2amigo Leaflet extension that adds the Leaflet.Draw functionality.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

plugin extension yii2 yii maps yii 2 widget leaflet icon davidjeddy

25/09 2015

0.1.0

0.1.0.0

Plugin for the 2amigo Leaflet extension that adds the Leaflet.Draw functionality.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

plugin extension yii2 yii maps yii 2 widget leaflet icon davidjeddy

25/09 2015

dev-unitTest_iteration_1

dev-unitTest_iteration_1

Plugin for the 2amigo Leaflet extension that adds the Leaflet.Draw functionality.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

plugin extension yii2 yii maps yii 2 widget leaflet icon davidjeddy

25/09 2015

0.0.2

0.0.2.0

Plugin for the 2amigo Leaflet extension that adds the Leaflet.Draw functionality.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

plugin extension yii2 yii maps yii 2 widget leaflet icon davidjeddy

24/09 2015

dev-dev

dev-dev

Plugin for the 2amigo Leaflet extension that adds the Leaflet.Draw functionality.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

plugin extension yii2 yii maps yii 2 widget leaflet icon davidjeddy

24/09 2015

0.0.1

0.0.1.0

Plugin for the 2amigo Leaflet extension that adds the Leaflet.Draw functionality.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

plugin extension yii2 yii maps yii 2 widget leaflet icon davidjeddy

23/09 2015

dev-repo_packagist_prep_work

dev-repo_packagist_prep_work

Plugin for the 2amigo Leaflet extension that adds the Leaflet.Draw functionality.

  Sources   Download

BSD-3-Clause

The Requires

  • 2amigo/yii2-leaflet-extension ~1.0

 

The Development Requires

plugin extension yii2 yii maps yii 2 widget leaflet icon davidjeddy

23/09 2015

dev-jslib_addition

dev-jslib_addition

Plugin for the 2amigo Leaflet extention that adds the Leaflet.Draw functionality.

  Sources   Download

BSD-3-Clause

The Requires

  • 2amigo/yii2-leaflet-extension ~1.0

 

The Development Requires

plugin extension yii2 yii maps yii 2 widget leaflet icon davidjeddy