Update marker

This commit is contained in:
Erik Michaels-Ober 2011-02-23 10:50:30 -05:00
parent 666047a9bf
commit 49c09935ed
2 changed files with 10 additions and 10 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 947 B

View File

@ -1,17 +1,17 @@
$(function() { $(function() {
var map; var map;
currentFeature_or_Features = null; currentFeature_or_Features = null;
var roadStyle = { var roadStyle = {
strokeColor: "#FFFF00", strokeColor: "#FFFF00",
strokeWeight: 7, strokeWeight: 7,
strokeOpacity: 0.75 strokeOpacity: 0.75
}; };
var addressStyle = { var addressStyle = {
icon: "javascripts/geojson/img/marker-house.png" icon: "images/marker-hydrant.png"
}; };
var parcelStyle = { var parcelStyle = {
strokeColor: "#FF7800", strokeColor: "#FF7800",
strokeOpacity: 1, strokeOpacity: 1,
@ -19,7 +19,7 @@ $(function() {
fillColor: "#46461F", fillColor: "#46461F",
fillOpacity: 0.25 fillOpacity: 0.25
}; };
var latlng = new google.maps.LatLng(42.358431,-71.059773); var latlng = new google.maps.LatLng(42.358431,-71.059773);
var myOptions = { var myOptions = {
zoom: 14, zoom: 14,
@ -27,7 +27,7 @@ $(function() {
mapTypeId: google.maps.MapTypeId.ROADMAP mapTypeId: google.maps.MapTypeId.ROADMAP
}; };
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
function getHydrants() { function getHydrants() {
$.ajax({ $.ajax({
url: "http://civicapi.couchone.com/boston_fire_hydrants/_design/geo/_spatiallist/geojson/points", url: "http://civicapi.couchone.com/boston_fire_hydrants/_design/geo/_spatiallist/geojson/points",
@ -40,7 +40,7 @@ $(function() {
} }
}); });
} }
function clearMap(){ function clearMap(){
if (!currentFeature_or_Features) if (!currentFeature_or_Features)
return; return;
@ -52,7 +52,7 @@ $(function() {
currentFeature_or_Features.setMap(null); currentFeature_or_Features.setMap(null);
} }
} }
function showFeature(geojson, style){ function showFeature(geojson, style){
clearMap(); clearMap();
currentFeature_or_Features = new GeoJSON(geojson, style || null); currentFeature_or_Features = new GeoJSON(geojson, style || null);
@ -67,9 +67,9 @@ $(function() {
}else{ }else{
currentFeature_or_Features.setMap(map) currentFeature_or_Features.setMap(map)
} }
document.getElementById("put_geojson_string_here").value = JSON.stringify(geojson); document.getElementById("put_geojson_string_here").value = JSON.stringify(geojson);
} }
getHydrants(); getHydrants();
}) })