Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
Hover polyline on map

 
Post new topic   Reply to topic    mi3dot.org Forum Index -> Client-side
View previous topic :: View next topic  
Author Message
fL/.\Sh



Joined: 09 Mar 2006
Posts: 77
Location: Vž

PostPosted: 19.08.2011 17:25    Post subject: Hover polyline on map Add user to your forum ignore list Reply with quote

Pozdrav.
Molim za pomoć.

Što želim: Google kartu sa 2 polylinije (različite boje) ispod koje se nalazi "legenda" (dva diva ispunjena bojom polylinija). Efekt bi bio da kad radim hover na boju (u legendi) da se polylinija podeblja.

Dolje ću priložiti kod, ali da prije napomenem gdje sam stao. Kad prođem mišem preko diva iskoči alert (znači radi). U kodu postoji varijabla koja drži debljinu polylinije. Ne mogu spojiti funkciju i varijablu na onmouseover.

----------------------------

evo script(iz heada):

<script type="text/javascript">
function initialize() {
var mapDiv = document.getElementById('map-canvas');
var map = new google.maps.Map(mapDiv, {
center: new google.maps.LatLng(0, -180),
zoom: 2,
mapTypeId: google.maps.MapTypeId.ROADMAP
});

var debljinaLinije = 1;

var path = [new google.maps.LatLng(37.772323, -122.214897),
new google.maps.LatLng(21.291982, -157.821856),
new google.maps.LatLng(-18.142599, 178.431),
new google.maps.LatLng(-27.46758, 153.027892)];

var path2 = [new google.maps.LatLng(38.882327, -124.224892),
new google.maps.LatLng(23.181981, -157.631854),
new google.maps.LatLng(-14.252597, 173.331),
new google.maps.LatLng(-21.66756, 155.227891)];

var line = new google.maps.Polyline({
path: path,
strokeColor: '#0000ff',
strokeOpacity: 1.0,
strokeWeight: debljinaLinije
});

var line2 = new google.maps.Polyline({
path: path2,
strokeColor: '#00ff00',
strokeOpacity: 1.0,
strokeWeight: debljinaLinije
});

line.setMap(map), line2.setMap(map);

}

function podebljaj(x){
var debljinaLinije = x;
alert(x)
}

google.maps.event.addDomListener(window, 'load', initialize);
</script>

---------------

tijelo:

<body>
<div id="map-canvas" style="width: 500px; height: 400px"></div>
<div id="kontrole">

<div id="kontrola1" onmouseover="podebljaj(6);"></div>

</div>

</body>


-----------------

css:

div#kontrole{
width: 300px;
height: 50px;
}

div#kontrola1{
width: 25px;
height: 25px;
background-color: #00ff00;
}

div#kontrola2{
width: 25px;
height: 25px;
background-color: #0000ff;
}
Back to top
View user's profile Send private message
fL/.\Sh



Joined: 09 Mar 2006
Posts: 77
Location: Vž

PostPosted: 23.08.2011 07:22    Post subject: Add user to your forum ignore list Reply with quote

Riješeno!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    mi3dot.org Forum Index -> Client-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group