Skip to content

Commit

Permalink
Se incluye histórico también para la capa base
Browse files Browse the repository at this point in the history
  • Loading branch information
fpsampayo committed Jul 4, 2017
1 parent 6c8426b commit bdce35b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
1 change: 0 additions & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ <h4 class="panel-title">
</div>
<div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
<div class="panel-body" id="medidor">
Por implementar
<div id="sandbox-container">
<div class="input-group date">
<input id="fecha-catastro" type="text" class="form-control"><span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
Expand Down
17 changes: 10 additions & 7 deletions src/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class Map {

const catastroUrl = 'https://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx?'

const catastroBase = L.nonTiledLayer.wms(
this.catastroBase = L.nonTiledLayer.wms(
catastroUrl,
{
maxZoom: MAX_ZOOM,
Expand Down Expand Up @@ -82,7 +82,7 @@ export default class Map {

const baseMaps = {
PNOA: pnoa,
Catastro: catastroBase,
Catastro: this.catastroBase,
'Google Satellite': satellite
}

Expand Down Expand Up @@ -111,22 +111,25 @@ export default class Map {
this.highlight.addData(geoJson)
}
/**
*
* Activa el catastro histórico para la fecha seleccionada
* @param {string} dateString - Fecha en formato yyyy-mm-dd
*/
catastroHistorico(dateString) {

this.catastroOverlay._wmsUrl = "https://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx?TIME=" + dateString
this.catastroOverlay.addTo(this.map)

this.catastroBase._wmsUrl = "https://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx?TIME=" + dateString
this.catastroOverlay.redraw()
this.catastroBase.redraw()
}

/**
* Desactiva el catastro histórico
*/
desactivaCatastroHistorico() {
this.catastroOverlay._wmsUrl = "https://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx?"
this.catastroOverlay.addTo(this.map)

this.catastroBase._wmsUrl = "https://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx?"
this.catastroOverlay.redraw()
this.catastroBase.redraw()
}
}

0 comments on commit bdce35b

Please sign in to comment.