Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/05/2013, 05:19
_ikku_
 
Fecha de Ingreso: marzo-2012
Mensajes: 2
Antigüedad: 12 años, 1 mes
Puntos: 0
librería javascript cakephp 2

Hola,

Estoy intentando ejecutar un método con una librería, dentro de la libreria tengo esto:

var map;
var ajaxRequest;
var plotlist;
var plotlayers=[];

function initmap() {
// set up the map
map = new L.Map('map');

// create the tile layer with correct attribution
var osmUrl='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
var osmAttrib='Map data © OpenStreetMap contributors';
var osm = new L.TileLayer(osmUrl, {minZoom: 8, maxZoom: 12, attribution: osmAttrib});

// start the map in South-East England
map.setView(new L.LatLng(51.3, 0.7),9);
map.addLayer(osm);
}

y en cake primero la incluyo con:

echo $this->Html->script('leaflet');
echo $this->Html->script('leafletembed');

a continuación creo un div donde se ejecutará la función:

<div id="map"></div>

e intento ejecutarlo, pero no me encuentra el método, ¿Que estoy haciendo mal?

echo $this->Js->initmap();

La librería esta en /app/webroot/js