- Timestamp:
- Apr 18, 2010, 8:43:17 PM (15 years ago)
- Location:
- trunk/src/map/inc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/map/inc/nodemapWL.js
r7830 r7832 11 11 var overNode; 12 12 var markerSelected = ""; 13 var highlightCircle; 14 var currentMarker; 13 15 14 16 … … 82 84 }); 83 85 GEvent.addListener(marker, 'click', function() { 86 currentMarker = marker; 87 highlightCurrentMarker(); 84 88 mouseClickNode(current.id, current.name[0], marker); 85 89 }); … … 258 262 function mapZoomed() 259 263 { 264 highlightCurrentMarker() 260 265 if(!markerSelected == "") 261 266 { … … 282 287 function deSelect() 283 288 { 289 map.removeOverlay(highlightCircle); 284 290 selected = false; 285 291 loadXMLDoc("inc/node_info.php"); -
trunk/src/map/inc/overlay.js
r7798 r7832 19 19 return polygon; 20 20 } 21 22 23 24 function highlightCurrentMarker(){ 25 var markerPoint = currentMarker.getPoint(); 26 27 var polyPoints = Array(); 28 29 if (highlightCircle) { 30 map.removeOverlay(highlightCircle); 31 } 32 33 var mapNormalProj = G_NORMAL_MAP.getProjection(); 34 var mapZoom = map.getZoom(); 35 var clickedPixel = mapNormalProj.fromLatLngToPixel(markerPoint, mapZoom); 36 37 var polySmallRadius = 20; 38 39 var polyNumSides = 20; 40 var polySideLength = 18; 41 42 for (var a = 0; a<(polyNumSides+1); a++) { 43 var aRad = polySideLength*a*(Math.PI/180); 44 var polyRadius = polySmallRadius; 45 var pixelX = clickedPixel.x + polyRadius * Math.cos(aRad); 46 var pixelY = clickedPixel.y + polyRadius * Math.sin(aRad); 47 var polyPixel = new GPoint(pixelX,pixelY); 48 var polyPoint = mapNormalProj.fromPixelToLatLng(polyPixel,mapZoom); 49 polyPoints.push(polyPoint); 50 } 51 // Using GPolygon(points, strokeColor?, strokeWeight?, strokeOpacity?, fillColor?, fillOpacity?) 52 highlightCircle = new GPolygon(polyPoints,"#000000",2,0.0,"#F7FE2E",.5); 53 map.addOverlay(highlightCircle); 54 }
Note:
See TracChangeset
for help on using the changeset viewer.