Merhaba arkadaşlar, Şoyle bir isteğim var sizlerden, Bir Turkiye haritası var js le yapılmış ve bu haritada ben belli illerin rengini farklı yapmak istiyorum. 2 saattir uğraştım ama yapamadım. Bir yardımcı olabilir misiniz?
Sanırım gerekli olacak bu iki js dosyası, zaten index html de bişey yok sadece bir div alanı var
init.js
Kod:
/* Raphaël 2.1.0 - JavaScript Vector Library Copyright © 2008-2012 Dmitry Baranovskiy (http://raphaeljs.com) Copyright © 2008-2012 Sencha Labs (http://sencha.com) Licensed under the MIT (http://raphaeljs.com/license.html) license. *** @title : Interactive Turkey Map with RaphaelJS Edited by Selen GORA *** @title: Added modalbox */ var iscountyselected = false; var previouscountyselected = "blank"; var start = true; var past = lisanssız; var content_dir = "details"; $(function(), arr = new Array(); for (var county in paths) ); /* set blank colour */ if(arr[obj.id] != 'blank') /* prevent change of blank colour and mouse click */ ); /* add tool tip to map */ $('svg a').tipsy(); /* end tool tip to map */ /* add crests to bottom and set county selections */ obj.click(function()); }).error(function() ); /* @AUTHor: Taner DOGAN //END */ if(paths[arr[this.id]].value == 'notSelected') , 200); paths[previouscountyselected].value = "notSelected"; paths[arr[this.id]].value = "isSelected"; //alert(paths[arr[this.id]].value = "isSelected"); //alert(arr[this.id] + previouscountyselected); previouscountyselected = paths[arr[this.id]].name; if (!start && past != this) , 200); } past = this; start = false; } else if(paths[arr[this.id]].value == 'isSelected') , 200); paths[arr[this.id]].value = "notSelected"; /* set path value */ } });/* end mark selections */ /* county hover bump */ function hoverin(e), 300); } function hoverout(e), 300); } obj.mouseout(hoverout); obj.mouseover(hoverin); /* end county hover bump */ /* hide name div - !important do not delete - ajax uses contents for event search */ $('#countyInfo').hide(); $('#spinner').hide(); /* @AUTHor: Taner DOGAN //START */ $(".close").live("click", function(), 200); past.animate().mouseover( function() , 300); }) past.animate().mouseout( function() , 300); }) }); /* @AUTHor: Taner DOGAN //END */ }/* end check on blank */ /*Resize Map*/ r.setViewBox(0,0,1050,620,true); r.setSize("100%","100%"); } /* end raphael loop */ });
paths.js Bu js de ben 2 tane il bıraktım konu karakter sayısını aştığı icin, ben bu 2 ilden 1ini renkli yapmak istiyorum.
Kod:
/* Raphaël 2.1.0 - JavaScript Vector Library Copyright © 2008-2012 Dmitry Baranovskiy (http://raphaeljs.com) Copyright © 2008-2012 Sencha Labs (http://sencha.com) Licensed under the MIT (http://raphaeljs.com/license.html) license. *** Document : Interactive Turkey Map with RaphaelJS Edited by Selen GORA */ var paths = , balikesir: , bilecik: }