-
-
Save brianherbert/850031 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
var ci_styles = new OpenLayers.StyleMap({ | |
"default": new OpenLayers.Style({ | |
pointRadius: "10", // sized according to type attribute | |
fillColor: "${fillcolor}", | |
strokeColor: "${strokecolor}", | |
strokeWidth: 2, | |
graphicZIndex: 1 | |
}, | |
{ | |
context: | |
{ | |
fillcolor: function(feature) | |
{ | |
}, | |
strokecolor: function(feature) | |
{ | |
}, | |
} | |
}), | |
"select": new OpenLayers.Style({ | |
fillColor: "#66ccff", | |
strokeColor: "#3399ff", | |
graphicZIndex: 2 | |
}) | |
}); | |
var checkinLayer = new OpenLayers.Layer.Vector('Checkins', {styleMap: ci_styles}); | |
map.addLayers([checkinLayer]); | |
$.getJSON("<?php echo url::site()."api/?task=checkin&action=get_ci&mapdata=1&sqllimit=1000&orderby=checkin.checkin_date&sort=DESC"?>", function(data) { | |
$.each(data["payload"]["checkins"], function(key, ci) { | |
var cipoint = new OpenLayers.Geometry.Point(parseFloat(ci.lon), parseFloat(ci.lat)); | |
cipoint.transform(proj_4326, proj_900913); | |
var checkinPoint = new OpenLayers.Feature.Vector(cipoint, {strokecolor: "#FF44FF"}); | |
checkinLayer.addFeatures([checkinPoint]); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment