Skip to content

Instantly share code, notes, and snippets.

@byron-perez
Created July 6, 2017 04:07
Show Gist options
  • Save byron-perez/aa657c46b46ec326d0c51867ccef3d95 to your computer and use it in GitHub Desktop.
Save byron-perez/aa657c46b46ec326d0c51867ccef3d95 to your computer and use it in GitHub Desktop.
ejercicios julio 05 2017
<!DOCTYPE html>
<html>
<head>
<title> ejercicio</title>
</head>
<body>
<span id="stars">
<img id="1" src="hola/chistosas.jpg" onclick="cambiar();">
<img src="hola/chistosas.jpg">
<img src="hola/chistosas.jpg">
</span>
</body>
<script type="text/javascript">
function cambiar()
{
document.getElementById("stars").children[1].src = 'hola/hola2.jpg';
}
</script>
</html>
<html>
<head>
</head>
</html>
<script type="text/javascript">
title = document.getElementById('34').childNodes[0].childNodes[1].childNodes[0].;
title = document.getElementById('atajo').src;
</script>
<!DOCTYPE html>
<html>
<head>
<title>Quick Start - Leaflet</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/x-icon" href="docs/images/favicon.ico" />
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.1.0/dist/leaflet.css" integrity="sha512-wcw6ts8Anuw10Mzh9Ytw4pylW8+NAD4ch3lqm9lzAsTxg0GFeJgoAtxuCLREZSC5lUXdVyo/7yfsqFjQ4S+aKw==" crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.1.0/dist/leaflet.js" integrity="sha512-mNqn2Wg7tSToJhvHcqfzLMU6J4mkOImSPTxVZAdo+lcPlk+GhZmYgACEe0x35K7YzW1zJ7XyJV/TT1MrdXvMcA==" crossorigin=""></script>
</head>
<body>
<div id="mapid" style="width: 600px; height: 400px;"></div>
<script>
var mymap = L.map('mapid').setView([-0.29575, -78.54068], 20);
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
maxZoom: 18,
attribution: '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>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>',
id: 'mapbox.streets'
}).addTo(mymap);
L.marker([-0.29575, -78.54068]).addTo(mymap)
.bindPopup("<b>HOLA!</b><br />Te encuentras aqui.").openPopup();
L.marker([-0.22362, -78.5179]).addTo(mymap)
.bindPopup("<b>HOLA!</b><br />Te encuentras aqui.").openPopup();
L.circle([-0.29575, -78.54068], 10, {
color: 'red',
fillColor: '#f03',
fillOpacity: 0.5
L.circle([-0.22362, -78.5179], 10, {
color: 'red',
fillColor: '#f03',
fillOpacity: 0.5
}).addTo(mymap).bindPopup("I am a circle.");
L.polygon([
[-0.29575, -78.54068],
[-0.22362, -78.5179]
]).addTo(mymap).bindPopup("I am a polygon.");
var popup = L.popup();
function onMapClick(e) {
popup
.setLatLng(e.latlng)
.setContent("You clicked the map at " + e.latlng.toString())
.openOn(mymap);
}
mymap.on('click', onMapClick);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment