Help

15 views
Skip to first unread message

Fernando

unread,
Jun 22, 2013, 8:44:21 PM6/22/13
to poly...@googlegroups.com
Hi would like to know how to do to put an image on the map I already gave the coordinates but not how to put an image example http://i824.photobucket.com/albums/zz166/facacabemer/Iconos/faca_zps530eb829.png
and that image is a shortcut to a Web or e ... can help me please Thanks greetings Fernando


var po = org.polymaps;

var svg = n$("#map").add("svg:svg");

var map = po.map()
    .container($n(svg))
    .center({lat: -33.2480, lon: -58.0326})
    .zoom(17)
    .add(po.interact());

/* MAPA */
map.add(po.image()
    .url(po.url("http://{S}tile.cloudmade.com"
    + "/1a1b06b230af4efdbb989ea99e9841af" // http://cloudmade.com/register
    + "/998/256/{Z}/{X}/{Y}.png")
    .hosts(["a.", "b.", "c.", ""])));


map.add(po.geoJson()
    .features([{geometry: {coordinates: [-58.0326, -33.2480], type: "Point"}}])
    .on("load", load));


map.add(po.geoJson()
    .features([{geometry: {coordinates: [-58.03223, -33.24795], type: "Point"}}])
    .on("load", load));

map.add(po.compass()
    .pan("none"));

/* Create a shadow filter. */
svg.add("svg:filter")
    .attr("id", "shadow")
    .attr("width", "140%")
    .attr("height", "140%")
  .add("svg:feGaussianBlur")
    .attr("in", "SourceAlpha")
    .attr("stdDeviation", 3);

/* Create radial gradient r1. */
svg.add("svg:radialGradient")
    .attr("id", "r1")
    .attr("fx", 0.2)
    .attr("fy", 0.2)
  .add("svg:stop")
    .attr("offset", "100%")
    .attr("stop-color", "#FF0000")
    .parent()
  .add("svg:stop")
    .attr("offset", "100%")
    .attr("stop-color", "#0f2f13");

/* Create radial gradient r1. */
svg.add("svg:radialGradient")
    .attr("id", "r1")
    .attr("fx", 0.2)
    .attr("fy", 0.6)
  .add("svg:stop")
    .attr("offset", "100%")
    .attr("stop-color", "#FA0000")
    .parent()
  .add("svg:stop")
    .attr("offset", "100%")
    .attr("stop-color", "#0f2f13");

/* Create radial gradient r2. */
svg.add("svg:radialGradient")
    .attr("id", "r2")
    .attr("fx", 0.2)
    .attr("fy", 0.6)
  .add("svg:stop")
    .attr("offset", "100%")
    .attr("stop-color", "#cccccc")
    .parent()
  .add("svg:stop")
    .attr("offset", "100%")
    .attr("stop-color", "#cccccc")
    .attr("stop-opacity", 0);

/** Post-process the GeoJSON points and replace them with shiny balls! */
function load(e) {
  var r = 1 * Math.pow(2, e.tile.zoom - 14);
  for (var i = 0; i < e.features.length; i++) {
    var c = n$(e.features[i].element),
        g = c.parent().add("svg:g", c);

    g.attr("transform", "translate(" + c.attr("cx") + "," + c.attr("cy") + ")");

    g.add("svg:circle")
        .attr("r", r)
        .attr("transform", "translate(" + r + ",0)skewX(-45)")
        .attr("opacity", .5)
        .attr("filter", "url(#shadow)");

    g.add(c
        .attr("fill", "url(#r1)")
        .attr("r", r)
        .attr("cx", null)
        .attr("cy", null));

    g.add("svg:circle")
        .attr("transform", "scale(.5,1)")
        .attr("fill", "url(#r2)")
        .attr("r", r);
  }
}

Reply all
Reply to author
Forward
0 new messages