Skip to content

Instantly share code, notes, and snippets.

Created December 27, 2019 18:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
let marcador = new ol.Feature({
geometry: new ol.geom.Point(
ol.proj.fromLonLat([-99.12105, 19.419617])// En dónde se va a ubicar
// Agregamos icono
image: new{
src: "pizza.png",
// marcadores debe ser un arreglo
const marcadores = []; // Arreglo para que se puedan agregar otros más tarde
marcadores.push(marcador);// Agregamos el marcador al arreglo
let capa = new ol.layer.Vector({
source: new ol.source.Vector({
features: marcadores, // A la capa le ponemos los marcadores
// Y agregamos la capa al mapa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment