Kategorien
PHP Yii Framework

Yii Simple Open Street Map Extension

The Simple Open Street Map Extension for Yii is a fast and comftable was to show multiple markers and a Open Street Map.

Features

  • automatic Zoom Factors, might be adjusted a little bit for street map zooms
  • Html Marker Text with Links etc.
  • Open Street Map License *free*
  • easy to use
open_street_map_yii
Open Street Map Yii Extension for the 10 biggest cities in brasil

 

Usage

Objects/ActiveRecords with the following property must be set for the points/cities to be displayed:

<?php
 $object->latitude;
 $object->longitude;

//And a class function like "getAllAttributes" 

class object
    public function  getAllAttributes(){
        $attr = $this->attributes; //Yii magic function to get all class attributes
        $attr["markerHtml"] = "hello";
        return $attr;
    }

and passed to the extension like:

<?php
$this->widget("ext.OpenLayers.OpenLayers", array("cities" => $objectsArray))

The result can be view here: Demo

You can Download the extension here.

Installation

Unzip the Files in protected/extensions/ and use like shown above

Download

OpenLayers_yii_extension