Well, of course, getting sufficient potassium is always a good idea, so I second eating bananas, melons, etc.
On the other hand, since you seem to get that cramping pain only when you walk, it sounds to me like you may have three very active triggerpoints/knots in play at the top of your back calves in your Gastrocnemius Muscles, which would be restricting your circulation & causing pain.
If so, to deactivate them, I'd try a several-times-daily deep massage of that area. You might also check in with your physician to eliminate the possibility of more serious circulation problems,but personally I'd try the potassium/massage regimen first.
Now if you're interested in suggestions on best how to effectively massage that particular area, let me know.