twgeomap_250K_test

just test.

by marcus211

HTML

<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css">
 <!-- Make sure you put this AFTER Leaflet's CSS -->
 <script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
   
<div id="map"></div>

CSS

#map {
 border: 1px solid;
 width: 100%;
 height: 400px;
}

JavaScript

// We’ll add a tile layer to add to our map, in this case it’s a OSM tile layer.
// Creating a tile layer usually involves setting the URL template for the tile images
var osmUrl = 'http://{s}.tile.osm.org/{z}/{x}/{y}.png',
	 	osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
	 	osm = L.tileLayer(osmUrl, {
	 	      maxZoom: 10,
	 	      attribution: osmAttrib
});

// initialize the map on the "map" div with a given center and zoom
var map = L.map('map', {
    center: [25.0465592,121.5133752],
    zoom: 13
}).addLayer(osm);

//add wms
var geowms = L.tileLayer.wms("http://gis.moeacgs.gov.tw/geo4oracle/mapagent/mapagent.fcgi?Request=GetMap&SERVICE=WMS&VERSION=1.1.1&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&SRS=EPSG:4326&FORMAT=image/png&layers=WMS2009/LAYER/250K/G67_TW_LIZA1A1PLP_P_1974_ALLSCALE,WMS2009/LAYER/250K/G67_TW_LIZA1A1PLL_L_1974_ALLSCALE&width=600&height=600", {
    format: 'image/png',
    transparent: true,
    crs:  L.CRS.EPSG4326
});
var geotext = L.tileLayer.wms("http://gis.moeacgs.gov.tw/geo4oracle/mapagent/mapagent.fcgi?Request=GetMap&SERVICE=WMS&VERSION=1.1.1&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&SRS=EPSG:4326&FORMAT=image/png&layers=WMS2009/LAYER/250K/G67_TW_LIZA1A1PLP_P_1974_TEXT_ALLSCALE&width=600&height=600", {
    format: 'image/png',
    transparent: true,
    crs:  L.CRS.EPSG4326
});
geowms.addTo(map);
geotext.addTo(map);